gluon-cv | | Installation | Documentation | Tutorials | Machine Learning library
kandi X-RAY | gluon-cv Summary
kandi X-RAY | gluon-cv Summary
| Installation | Documentation | Tutorials |. GluonCV provides implementations of the state-of-the-art (SOTA) deep learning models in computer vision.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Train the Gluon network .
- Load a COCO .
- Export the given block to TVM .
- Compute the direct loss for each class .
- Train image classification .
- Overlay instances .
- Convert dataset dict to COCO format .
- Autocomplete .
- Fit the model .
- Export a block of data
gluon-cv Key Features
gluon-cv Examples and Code Snippets
"""2. Train Mask RCNN end-to-end on MS COCO
===========================================
This tutorial goes through the steps for training a Mask R-CNN [He17]_ instance segmentation model
provided by GluonCV.
Mask R-CNN is an extension to the Faster
"""06. Train Faster-RCNN end-to-end on PASCAL VOC
================================================
This tutorial goes through the basic steps of training a Faster-RCNN [Ren15]_ object detection model
provided by GluonCV.
Specifically, we show how t
"""04. Train SSD on Pascal VOC dataset
======================================
This tutorial goes through the basic building blocks of object detection
provided by GluonCV.
Specifically, we show how to build a state-of-the-art Single Shot Multibox
De
def find_class_idx(label):
"""
Should return the class index of a particular label.
:param label: label of class
:type label: str
:return: class index
:rtype: int
"""
return network.classes.index(label)
# map class ID to classes
id2string = [i:name for i, name in enumerate(net.classes)]
# filter on score.
thresh = 0.8
top_classIDs = [c for c, s in zip(box_ids[0], scores[0]) if s > thresh]
# convert IDs to class names into "label1"
la
rgb_nd = rgb_nd.as_in_context(ctx)
class_IDs, scores, bounding_boxes = net(rgb_nd)
class_IDs, scores, bounding_boxes = net(rgb_nd)
if isinstance(class_IDs, mx.ndarray.ndarray.NDArray):
class_IDs.wai
from matplotlib import pyplot as plt
from gluoncv import model_zoo, data, utils
from gluoncv.data.transforms.pose import detector_to_alpha_pose, heatmap_to_coord_alpha_pose
detector = model_zoo.get_model('yolo3_mobilenet1.0_coco', pretrai
net.set_nms(nms_thresh=0.5, nms_topk=50)
#!/usr/bin/python3
# 2019/01/24 09:05
# 2019/01/24 10:25
import gluoncv as gcv
import mxnet as mx
import cv2
import numpy as np
# https://github.com/pjreddie/darknet/blob/master/data/dog.jpg
## (1) Create network
net = gcv.model_zoo.get
Community Discussions
Trending Discussions on gluon-cv
QUESTION
I used GluonCV to finetune an object detection model in order to recognize some custom classes, mostly following the related tutorial.
I tried using both “ssd_512_resnet50_v1_coco” and “ssd_512_mobilenet1.0_coco” as base models, and the training process ended successfully (the accuracy on the validation dataset is reasonably high).
The problem is, I tried running inference with the newly trained model, by using for example:
...ANSWER
Answered 2020-Aug-24 at 13:46Ok, fixed it. Basically, during training I was saving the .params file by using:
QUESTION
Similar to the issue of The trained model can be deployed on the other platform without dependency of sagemaker or aws service?.
I have trained a model on AWS SageMaker by using the built-in algorithm Semantic Segmentation. This trained model named as model.tar.gz
is stored on S3. So I want to download this file from S3 and then use it to make inference on my local PC without using AWS SageMaker anymore. Since the built-in algorithm Semantic Segmentation is built using the MXNet Gluon framework and the Gluon CV toolkit, so I try to refer the documentation of mxnet and gluon-cv to make inference on local PC.
It's easy to download this file from S3, and then I unzip this file to get three files:
- hyperparams.json: includes the parameters for network architecture, data inputs, and training. Refer to Semantic Segmentation Hyperparameters.
- model_algo-1
- model_best.params
Both model_algo-1 and model_best.params are the trained models, and I think it's the output from net.save_parameters
(Refer to Train the neural network). I can also load them with the function mxnet.ndarray.load
.
Refer to Predict with a pre-trained model. I found there are two necessary things:
- Reconstruct the network for making inference.
- Load the trained parameters.
As for reconstructing the network for making inference, since I have used PSPNet from training, so I can use the class gluoncv.model_zoo.PSPNet
to reconstruct the network. And I know how to use some services of AWS SageMaker, for example batch transform jobs, to make inference. I want to reproduce it on my local PC. If I use the class gluoncv.model_zoo.PSPNet
to reconstruct the network, I can't make sure whether the parameters for this network are same those used on AWS SageMaker while making inference. Because I can't see the image 501404015308.dkr.ecr.ap-northeast-1.amazonaws.com/semantic-segmentation:latest
in detail.
As for loading the trained parameters, I can use the load_parameters
. But as for model_algo-1 and model_best.params, I don't know which one I should use.
ANSWER
Answered 2020-Mar-02 at 05:15The following code works well for me.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gluon-cv
GluonCV supports Python 3.6 or later. The easiest way to install is via pip.
GluonCV supports Python 3.6 or later. The easiest way to install is via pip.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page