Skip to content

Instantly share code, notes, and snippets.

View PINTO0309's full-sized avatar
🤣
I may be slow to respond.

Katsuya Hyodo PINTO0309

🤣
I may be slow to respond.
View GitHub Profile
@quantombone
quantombone / nms_fast.m
Created August 14, 2011 00:26
blazing fast nms (non-maximum suppression)
function top = nms(boxes, overlap)
% top = nms_fast(boxes, overlap)
% Non-maximum suppression. (FAST VERSION)
% Greedily select high-scoring detections and skip detections
% that are significantly covered by a previously selected
% detection.
% NOTE: This is adapted from Pedro Felzenszwalb's version (nms.m),
% but an inner loop has been eliminated to significantly speed it
% up in the case of a large number of boxes
% Tomasz Malisiewicz ([email protected])
@iwatake2222
iwatake2222 / detection_PC.py
Last active August 27, 2024 10:37
Object detection using MobileNet SSD with tensorflow lite (with and without Edge TPU)
# -*- coding: utf-8 -*-
import cv2
import tensorflow as tf
import numpy as np
# https://www.tensorflow.org/lite/guide/hosted_models
# http://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip
def detect_from_camera():
@akaanirban
akaanirban / gist:621e63237e63bb169126b537d7a1d979
Last active March 22, 2022 00:40
Install pyTorch in Raspberry Pi 4 (or any other)

Edit 04/11/2021: This gist is quite old now. The current version of PyTorch is 1.8.1, which is miles ahead of version 1.0.1 that I was trying to install when I wrote this gist. Therefore some of the instructions may not apply, or some dependencies may have changed or bugs taken care of. I do not currently have a Raspberry Pi to verify unfortunately. Please proceed with caution. Further, there are may others who have shared their fixes, and direct links to their wheels down in the comments. Cheers !

Install the prerequisites (the last one for numpy):

sudo apt install libopenblas-dev libblas-dev m4 cmake cython python3-yaml libatlas-base-dev

Increase the swap size:

  • Stop the swap : sudo dphys-swapfile swapoff
  • Modify the size of the swap by editing as root the following file : /etc/dphys-swapfile. Modify the valiable CONF_SWAPSIZE and change its value to CONF_SWAPSIZE=2048
@NobuoTsukamoto
NobuoTsukamoto / keras-post-training-quantization.ipynb
Last active June 28, 2020 17:23
Keras Post-training quantization.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmabir17
bmabir17 / convert.py
Last active February 6, 2022 20:54
Converts the mask-rcnn keras model https://github.com/matterport/Mask_RCNN/releases/tag/v2.0 to tflite
import tensorflow as tf
import numpy as np
import mrcnn.model as modellib # https://github.com/matterport/Mask_RCNN/
from mrcnn.config import Config
import keras.backend as keras
PATH_TO_SAVE_FROZEN_PB ="./"
FROZEN_NAME ="saved_model.pb"
@tomoaki0705
tomoaki0705 / text.md
Last active July 1, 2024 14:32
「OpenCVの画像処理をGPU(CUDA)で高速化する」を読んでresizeをマルチコア対応するお話。

はじめに

OpenCVでの処理(リサイズなど)を、簡単にマルチコア化する方法をどなたかご存知でしたら教えて頂けないでしょうか? TBBを使ってスレッドを作る方法は色々見つかったのですが、単にcv::resize()をマルチコア動作で高速化させたいです。

TL;DR

  • Python バインディングが遅い
  • OpenCV の resize はずっと昔からマルチコア対応している
@NobuoTsukamoto
NobuoTsukamoto / export_tfv2_lite_models.ipynb
Last active January 7, 2022 06:54
export_tfv2_lite_models.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kounoike
kounoike / Dockerfile
Created January 2, 2021 18:49
UniverseNet+manga109
ARG PYTORCH="1.5"
ARG CUDA="10.1"
ARG CUDNN="7"
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0+PTX"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"
@UnaNancyOwen
UnaNancyOwen / README.md
Last active January 19, 2024 07:00
OpenCV ObjDetect Module Face Recognition (SFace) Sample

OpenCV ObjDetect Module Face Recognition (SFace) Sample

    1. Generate Aligned Faces
    python generate_aligned_faces.py image.jpg
    
    • Input
      input