Skip to content

Instantly share code, notes, and snippets.

View mahxn0's full-sized avatar
🌴
On vacation

mahxn0 mahxn0

🌴
On vacation
View GitHub Profile
@mahxn0
mahxn0 / googlenet_caffe_demo.py
Created January 14, 2019 06:47
googlenet caffe
#coding=utf-8
import numpy as np
import cv2
import matplotlib.pyplot as plt
import os
import PIL
from PIL import Image
caffe_root = '/home/mahxn0/caffe/'
work_dir='/home/mahxn0/workspace/src/detectAndRecog/src/caffenet/model-googlenet-watch/'
@mahxn0
mahxn0 / maskrcnn_cv_demo.py
Created January 14, 2019 06:46
maskrcnn opencv inference demo
import cv2 as cv
import argparse
import numpy as np
import os.path
import sys
import random
# Initialize the parameters
confThreshold = 0.3 # Confidence threshold
maskThreshold = 0.5 # Mask threshold
@mahxn0
mahxn0 / maskrcnn_cv_graph.py
Created January 14, 2019 06:44
maskrcnn tensorflow to opencv
import argparse
import numpy as np
from tf_text_graph_common import *
parser = argparse.ArgumentParser(description='Run this script to get a text graph of '
'Mask-RCNN model from TensorFlow Object Detection API. '
'Then pass it with .pb file to cv::dnn::readNetFromTensorflow function.')
parser.add_argument('--input', required=True, help='Path to frozen TensorFlow graph.')
parser.add_argument('--output', required=True, help='Path to output text graph.')
parser.add_argument('--config', required=True, help='Path to a *.config file is used for training.')
@mahxn0
mahxn0 / deeplabv3_demo.py
Created January 14, 2019 06:42
deeplabv3+ demo
# codinf=utf-8
import sys
sys.path.append('./utils/')
from matplotlib import pyplot as plt
import numpy as np
from PIL import Image
import tensorflow as tf
import get_dataset_colormap
import os
import matplotlib