Giter VIP home page Giter VIP logo

yolov2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yolov2's Issues

Problem in utils.py

The following lines in lib/utils.py result in a 0 value for some images in my case:

input_width *= min_pixel / min_edge
input_height *= min_pixel / min_edge

AND

input_width *= max_pixel / max_edge
input_height *= max_pixel / max_edge

Which in turn causes "cv2.resize(img, (input_width, input_height))" to fail with an error. Changing these lines to something like "input_height *= max_pixel / (max_edge * 1.0)" fixes the problem for me

How to choose anchors

Could you please explain how did you choose anchors ?
self.anchors = [[5.375, 5.03125], [5.40625, 4.6875], [2.96875, 2.53125], [2.59375, 2.78125], [1.9375, 3.25]]

I think what is mentioned in the original arXiv paper is ambiguous. I found a discussion on the official mailing list: https://groups.google.com/forum/#!searchin/darknet/anchors%7Csort:relevance/darknet/qrcGefJ6d5g/VaPBCeGaAwAJ

You can answer in Japanese if you prefer.
他の方が英語で書いていたので英語で書きましたが、日本語の方が好きでしたら、そちらでも構いません。よろしくお願いします。

Failed to run partial_weights.py

I run the training programs to detect animal icons according to YOLOv2_animal_train.md , but partial_weights.py failed to dump as below in my environment.

$ python partial_weights.py
Traceback (most recent call last):
  File "partial_weights.py", line 9, in <module>
    from yolov2_grid_prob import *
ModuleNotFoundError: No module named 'yolov2_grid_prob'

I cannot find the module called yolov2_grid_prob. Could you give me some advice on what shoud I do?

Failed to run image_generator.py because randint arg is negative number

@leetenki
Failed to run image_generator.py because randint arg is negative number
I got the errors in the image_generator.py .
First:

  File "image_generate.py", line 24, in <module>
    delta_val_scale=0.5
  File "/home/autoware/workspace/chainer_ws/YOLOv2/lib/image_generator.py", line 171, in generate_samples
    tmp_image, bbox = random_overlay_image(sample_image, item, minimum_crop)
  File "/home/autoware/workspace/chainer_ws/YOLOv2/lib/image_generator.py", line 76, in random_overlay_image
    x = int(np.random.randint(src_w-scale_item_w) - shift_item_w)
  File "mtrand.pyx", line 977, in mtrand.RandomState.randint (numpy/random/mtrand/mtrand.c:16117)
ValueError: low >= high

Second:

loading image generator...
loading model...
start training
Traceback (most recent call last):
  File "darknet19_train.py", line 62, in <module>
    delta_val_scale=0.5
  File "/home/autoware/workspace/chainer_ws/YOLOv2/lib/image_generator.py", line 161, in generate_samples
    bg = self.bgs[np.random.randint(len(self.bgs))]
  File "mtrand.pyx", line 977, in mtrand.RandomState.randint (numpy/random/mtrand/mtrand.c:16117)
ValueError: low >= high

problem in yolov2_darknet_parser.py

when I was executing
python yolov2_darknet_parser.py yolo.weights

I had a error like,

File "yolov2_darknet_parser.py", line 87, in <module>
    exec(txt)
  File "<string>", line 1, in <module>
ValueError: cannot reshape array of size 12265129 into shape (1024,3072,3,3)

Is the model construction correct ?

error in darknet19_train.py

After stat training, I encountered this error in darknet19_train.py
Do you have information about this?

Traceback (most recent call last):

File "", line 75, in
y, loss, accuracy = model(x, one_hot_t)

File "/Users/-/darknet19.py", line 122, in call
y = self.predictor(x)

File "/Users/-/darknet19.py", line 85, in call
h = F.leaky_relu(self.bias1(self.bn1(self.conv1(x), test=not self.train, finetune=self.finetune)), slope=0.1)

File "/Users/-/.pyenv/versions/anaconda3-4.3.1/envs/py3yolo/lib/python3.5/site-packages/chainer/links/normalization/batch_normalization.py", line 117, in call
kwargs, test='test argument is not supported anymore. '

File "/Users/-/.pyenv/versions/anaconda3-4.3.1/envs/py3yolo/lib/python3.5/site-packages/chainer/utils/argument.py", line 4, in check_unexpected_kwargs
raise ValueError(message)

ValueError: test argument is not supported anymore. Use chainer.using_config

Bounding box difference?

Bounding boxがオリジナルのdarknetのものより小さめに出る気がするのですが、何かコメントありますか?

"ValueError : low >= high" in darknet19_train.py

hey guys, i got the value error when i tried the training tutorial.
the below is the whole message

=================================================================================

loading image generator...
loading model...
/home/kaku/anaconda3/lib/python3.5/site-packages/chainer/cuda.py:90: UserWarning: cuDNN is not enabled.
Please reinstall chainer after you install cudnn
(see https://github.com/pfnet/chainer#installation).
'cuDNN is not enabled.\n'
start training
Traceback (most recent call last):
File "darknet19_train.py", line 62, in
delta_val_scale=0.5
File "/home/kaku/Desktop/YOLOv2-master/lib/image_generator.py", line 180, in generate_samples
bg = self.bgs[np.random.randint(len(self.bgs))]
File "mtrand.pyx", line 988, in mtrand.RandomState.randint (numpy/random/mtrand/mtrand.c:16157)
ValueError: low >= high

=================================================================================
REALLY NEED HELP, PLEASE

Which GPU do you use?

GTX1060の6GBでTrainingしようとして、メモリが足りない的なメッセージが出たのですが、
leetenkiさんがお使いのGPUは何なのでしょうか?
参考までにお教え願えないでしょうか?

cannot have the correct output with training darknet19

hey guys, i started train YOLOv2 using the tutorial.
but when i finish it and then run
python darknet19_predict.py items/Dog.png
this code, always get incorrect output like below.
##############################################
loading image...
loading model...
1Tyrannosaurus : 44.34%
6Dog : 33.14%
5Rhino : 21.69%
9Parasarolophus : 0.37%
3Triceratops : 0.30%
4Riopururodon : 0.09%
7Erasmosaurus : 0.03%
8Ammonite : 0.02%
10Deer : 0.02%
2Brachiosaurus : 0.01%
##############################################
or if i change the png file to deer, will get like below output.
##############################################
python darknet19_predict.py items/10Deer.png
loading image...
loading model...
1Tyrannosaurus : 99.96%
5Rhino : 0.03%
6Dog : 0.01%
9Parasarolophus : 0.00%
8Ammonite : 0.00%
2Brachiosaurus : 0.00%
4Riopururodon : 0.00%
7Erasmosaurus : 0.00%
10Deer : 0.00%
3Triceratops : 0.00%
##############################################

did anyone get the same trouble? or any idea to fix this?
REALLY NEED HELP, thank you.

Is multi-scale training implemented?

As shown in the paper, the multi-scale training can import the mAP on VOC 2007 test set by 1.4. Has multi-scale training been implemented by YOLOv2?

Darknet Model

Can anyone provide the yolov2_darknet model file for coco dataset?!

Output of Dimension Cluster

print(centroid.w * grid_width, centroid.h * grid_height)

Hi!

Thanks for your really nicely documented work! I had a quick question on the above snippet ^^. Why is it that you multiply the final centroid width and height by the grid width and height?

In my use case, the centroid widths and height correspond to say 20 pixels in the true image. I imagine this should then be divided by the grid width and height to determine the final anchor values (as the anchor values are multiplied by the grid width and height correct?).

Could you help me understand why you instead multiply by the grid dimensions to get the anchor values? If I did this method I would get anchor values of (260 etc.)

About the loss

what is the second term in the loss? I cannot find it in yolo v1 paper.
Why do you want the no-responsible boxes' center to be in the center of the grid?
Is it just for stabling the training in early stage?

Is anchor_default realy 1.0?

Anchor_default is written as 1.0 in YOLOv2.md, but in real code (yolov2.py), tw and th are set to 0 when no object exists. Please tell me which is correct.

YOLOv2.mdでanchor_defaultは1.0と表記されていますが、実際のコード(yolov2.py)では物体が存在しない場合はtw及びthに0が設定されています。どちらが正しいのかご教授お願い致します。

Train on Deepfashion dataset. Why are the loss increase to be NaN during training?

Original yolov2_train.py is based on images generated by merging foreground and background.
and the darknet19_train.py has only image classification.
And now, I wanna train yolov2 with Deepfashion Dataset with bbox.
I've made a image_generate script to output data, t.

  • data is the numpy array of an image;

  • t is the x,y,w,h,label for the data.

My chainer version is 4.
Also, delete the test = ... in yolov2.py (such as line 92), and use with chainer.using_config('train', True) in the yolov2_train.py, and with x, t = generate_samples(n_samples=1, width=input_width,height=input_height)
to generate 1 sample to debug.
comment out the debug_print.
During batch 1, everything's fine. but during batch 2, the self.conv1(x) will output NaN while x has real values.
My guess is the the W for conv1 is too large, but I can't verify it.

Has anyone encountered this problem? It'll be very kind that you guys can give me some hints.

The dataset I use is In-shop Clothes Retrieval Benchmark http://mmlab.ie.cuhk.edu.hk/projects/DeepFashion.html, just upper-body, lower-body, full-body, 3 classes.

Here is the screen shot.
1219_3

Here are the corresponding file

YS_YOLOv2.zip

Different performance from darknet

Does someone compare performance with darknet?
In my implementation, the detection speed is slower, and GPU usage rate is lower than darknet.

I have adjusted yolov2.py and yolov2_predict.py for my own dataset.
Please let me know if you have any idea to make the use of GPU more efficient in these source codes.

Question on yolo backward function

Hi there, sorry about that to post this here, i was trying to write yolo in torch but struggled the backward function for so many days, but the gradients are always exploding slowly, could you kindly shed a light on my codes? Thank you so much.

gradInput[{ {}, {}, 1, {}, {} }] = self.mse:backward(torch.cmul(self.x_buffer, x, coord_mask), tx)
gradInput[{ {}, {}, 2, {}, {} }] = self.mse:backward(torch.cmul(self.y_buffer, y, coord_mask), ty)
gradInput[{ {}, {}, 3, {}, {} }] = self.mse:backward(torch.cmul(self.w_buffer, w, coord_mask), tw)
gradInput[{ {}, {}, 4, {}, {} }] = self.mse:backward(torch.cmul(self.h_buffer, h, coord_mask), th)
gradInput[{ {}, {}, 5, {}, {} }] = self.mse:backward(torch.cmul(self.conf_buffer, conf, coord_mask), tconf)
gradInput[{ {}, {}, { 6, 5 + nC }, {}, {} }][self.cls_mask] = self.ce:backward(torch.cmul(self.cls_buffer, cls), tcls)

Error in yolov2.py AttributeError

I encountered this error in yolov2.py
Could you tell me how to fix it.

python yolov2_train.py

loading image generator...
item_files = ...
loading initial model...
start training
Traceback (most recent call last):
File "yolov2_train.py", line 82, in
loss = model(x, t)
File "/home/dl-box/YOLOv2/yolov2.py", line 168, in call
x_shift = Variable(np.broadcast_to(np.arange(grid_w), x.shape[1:]))
AttributeError: 'module' object has no attribute 'broadcast_to'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.