pip install gluoncv
pip install mxnet
Download model from https://modelzoo.co/model/ssd-mxnet, This step was not required, Figured out later this was due to below package issues scipy and matplotlib.
Error in Call back
pip uninstall scipy
pip install scipy
pip uninstall matplotlib
pip install matplotlib
Below is example code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mxnet as mx | |
import numpy as np | |
from mxnet import gluon, nd | |
from mxnet.gluon import nn | |
from mxnet.gluon.data.vision import transforms | |
from gluoncv import model_zoo, data, utils | |
from matplotlib import pyplot as plt | |
net = model_zoo.get_model('ssd_512_vgg16_atrous_voc', pretrained=True) | |
im_fname = utils.download('https://github.com/dmlc/web-data/blob/master/' + | |
'gluoncv/detection/street_small.jpg?raw=true', | |
path='street_small.jpg') | |
x, img = data.transforms.presets.ssd.load_test(im_fname, short=512) | |
print('Shape of pre-processed image:', x.shape) | |
class_IDs, scores, bounding_boxes = net(x) | |
ax = utils.viz.plot_bbox(img, bounding_boxes[0], scores[0],class_IDs[0], class_names=net.classes) | |
plt.show() | |
#https://github.com/ThomasDelteil/ObjectDetectionWebcam_MXNet/blob/master/detection.py | |
#https://github.com/ThomasDelteil/Awesome-MXNet#Vision | |
#https://github.com/ThomasDelteil/VisualSearch_MXNet | |
#https://thomasdelteil.github.io/FacialEmotionRecognition_MXNet/ | |
#https://github.com/TalkAI/facial-emotion-recognition-gluon/blob/master/notebooks/Gluon_FERPlus.ipynb |
C:\Users\#user#\.mxnet\models
The Output example is
Happy Mastering DL!!!
No comments:
Post a Comment