chainercv | ChainerCV : a Library for Deep Learning in Computer Vision | Machine Learning library
kandi X-RAY | chainercv Summary
kandi X-RAY | chainercv Summary
ChainerCV is a collection of tools to train and run neural networks for computer vision tasks using Chainer.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Generate vis image segmentation of the image
- Convert a mask to bounding box
- Visualize a vis image
- Convert a set of labels to vocab
- Forward computation
- Calculate bilinear interpolation
- Return the lower and lower bounds for a given range
- Apply a function to an iterator
- Unzip an iterable
- Prepare a pretrained model
- Given a bounding box and a bounding box and a bounding box encode the image
- Sets up the model
- Convert parameters to model
- Forward forward computation
- Convert bounding box to pixel coordinates
- Generate a vocab colormap
- Convert a mask to a bounding box
- Given a list of imgs and bboxes extract the image
- Visualize a bounding box
- Decode bounding box
- Run the prediction on the given images
- Visualize a visual segmentation
- Loads a model from a checkpoint file
- Compute the RPN curve
- Decode a set of roi angles
- Backward computation
- Performs the backward computation
- Decode a bounding box
- Predict for given images
chainercv Key Features
chainercv Examples and Code Snippets
[Detectron]
download_cache = SOMEPATH/detectron-download-cache
[deep_sort_features]
model = SOMEPATH/networks/mars-small128.pb
python detect_and_track.py
python evaluate.py experiments/yolov2_update_416_eval.yml --batchsize 32 --gpu 0
# fps of evaluation includes the time of loading images.
nms: by class
nms_thresh = 0.5
img_thresh = 0.001
・COCO
http://cocodataset.org/#download
・VOC
http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit
Community Discussions
Trending Discussions on chainercv
QUESTION
I have used SSD300(imagenet pre-trained model) for detection and recognition for two class classification:[Basketball-ChainerCV] (https://github.com/atom2k17/Basketball-ChainerCV/blob/master/basketballproject.py). The training and predictions are good. But when I am using SSD512(imagenet pre-trained model) while training, I get the following error:
...ANSWER
Answered 2019-Mar-20 at 07:49As suggested in the comments by @corochann this memory issue is solved when trainer.run() was executed taking batch_size as 4 from 32. So taking a smaller batch_size was the solution here.
QUESTION
I have an imageset of 250 images of shape (3, 320, 240) and 250 annotation files. I am using ChainerCV to detect and recognize two classes in the image: ball and player. Here we are using SSD300 model pre-trained on ImageNet dataset.
EDIT: CLASS TO CREATE DATASET OBJECT
...ANSWER
Answered 2019-Mar-06 at 04:23The issue was due to a small overlooked situation where the text files had gaps as the image list was cut, copied and pasted in the same file. The text files were created in notepad. In notepad index is not visible, but the gaps are visible once you view the text files in github where the initial indexing is still present and the indexing remains even though the list was cut down in size. E.g first a list of 182 images were created but later cut down to 170. So when we use the Dataset Creation object the code reads all the lines of the text file i.e it will read 182 instead of 170. This has affected training of the model with the dataset that was incorrectly read. A new set of text files for train, val and test was created and now the training proceeded correctly.
QUESTION
I want to train a Faster R-CNN with ChainerCV. As a first test I mostly copied the provided example, I only changed the lines corresponding the dataset to use my custom dataset. I checked if my dataset is fully functional with all operations discribed in this tutorial.
If I run the script without changes everything works perfect, but if I change the batch_size I get an error. I tried increasing the shared_mem from 100 MB to 1000 MB, but the error didn’t disappear.
Error when setting the batch_size=2:
...ANSWER
Answered 2019-Feb-16 at 07:08self.converter
assumes that the first argument of batch
is composed of inputs that have the same shape. For example, if you use image dataset, all images are supposed to have the shape of (C, H, W).
So, could you check your dataset returns images of the same shape?
And if your dataset has various shapes of images, how about using TransformDataset
like https://github.com/chainer/chainercv/blob/df63b74ef20f9d8c830e266881e577dd05c17442/examples/faster_rcnn/train.py#L86?
QUESTION
When trying to install some packages using pip
, I encountered an error.
Even switching the environments of Python, the same error came up. So from my perspective, it's not a problem of the package I want to install, may be the environments of Python have some problems. Any one can help me?
Environments:
- Windows 10
- Anaconda 4.5.2
- Python3.6
- pip 10.0.1
Here is the message from the command:
...ANSWER
Answered 2018-Jun-29 at 03:30Problem solved.
It is a problem of system encoding (Windows).
Change the System Encoding can solve the problem.
Reference:
QUESTION
Looking generate_anchor_base
method, which is Faster R-CNN util method in ChainerCV.
What is the base_size = 16
? I saw in the Documentation that it is
The width and the height of the reference window.
But what does "reference window" mean?
Also it says that anchor_scales=[8, 16, 32]
are the areas of the anchors but I thought that that the areas are (128, 256, 512)
Another question:
If the base size
is 16 and h = 128
and w=128
, Does that mean anchor_base[index, 0] = py - h / 2
is a negative value?
since py = 8 and and h/2 = 128/2
ANSWER
Answered 2018-Nov-18 at 13:39The method is a util function of Faster R-CNN, so I assume you understood what is the "anchor" proposed in Faster R-CNN.
- "Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks" https://arxiv.org/abs/1506.01497
base_size
and anchor_scales
determines the size of the anchor.
For example, when base_size=16
and anchor_scales=[8, 16, 32]
(and ratio=1.0
), height and width of the anchor will be 16 * [8, 16, 32] = (128, 256, 512)
, as you expected.
ratio
determines the height and width aspect ratio.
(I might be wrong in below paragraph, please correct if I'm wrong.)
I think base_size
need to be set as the size of the current hidden layer's scale. In the chainercv
Faster R-CNN implementation, extractor
's feature is fed into rpn
(region proposal network) and generate_anchor_base
is used in rpn
. So you need to take care what is the feature of extractor
's output. chainercv
uses VGG16 as the feature extractor, and conv5_3
layer is used as extracted feature (see here), this layer is a place where max_pooling_2d
is applied 4 times, which results 2^4=16 times smallen feature.
For the another question, I think your understanding is correct, py - h / 2
will be negative value. But this anchor_base
value is just a relative value. Once anchor_base
is prepared at the initialization of model (here), actual (absolute value) anchor
is created in each forward call (here) in _enumerate_shifted_anchor
method.
QUESTION
I find the chainercv project : https://github.com/chainer/chainercv I have read this code, the comment and code is excellent, but few detail still confuse me. I wonder: Does this code the exactly same logic as https://github.com/rbgirshick/py-faster-rcnn Which is orignal caffe implement.
...ANSWER
Answered 2017-Sep-04 at 07:35I wrote that code. The logic is not completely the same as py-faster-rcnn, but the difference is very subtle. Also, you can see more details here.
The changes are necessary for consistency in the library. As a side note, I made that change after completely replicating the behavior of py-faster-rcnn using Chainer. I checked correctness by checking outputs of my own code and py-faster-rcnn to be within the margin of numerical errors.
QUESTION
I have pretrained a VGG network in chainer loadable npz file format, but add a new FC layer to last layer , and I modify last layer output class_number. I have already modify the layer name in order to use chainer loadable file to other unaltered layer. But I failed.
...ANSWER
Answered 2017-Aug-09 at 12:08I made custom class to over write some layer like this. you can control load timing for pretrained model using init flag
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install chainercv
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