Giter VIP home page Giter VIP logo

yolov3's People

Contributors

dennistang742 avatar fzjpxlay avatar n3rdd avatar xiaochus avatar

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

yolov3's Issues

Opencv loads BGR images thus lowering detection accuracy

I have noticed that Opencv imread was loading color channels in BGR order, what I did not know before. Since I suppose the original weights are made to deal with the channels in RGB order, I swapped the channels back by adding the line:

image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

,at the beggining of the function process_image.

It indeed increased the detection rate especially for the yolo_tiny model. It may solve issue #8 btw.

TypeError: buffer is too small for requested array

When i convert my own trained yolov3.weights to .h5, the error will shown as follows:
Traceback (most recent call last):
File "yad2k.py", line 275, in
_main(parser.parse_args())
File "yad2k.py", line 151, in _main
buffer=weights_file.read(weights_size * 4))
TypeError: buffer is too small for requested array

How to solve this problem
Thanks!

Width, Height of Original YOLO

Hi,

I was looking at the original YOLO cfg here. It seems the original one accepts a input of size 608x608, not 416 as mentioned in your config file.

So, how is this even working considering you are downloading the weights for for the larger 608x608 image. I understand that the initial convolutions will be the same but the size of your outputs will be different. Am I mistaking something here?

Update: looks like the cfg file was changed 4 days ago. But still the question remains as to why it worked given the weights would have been from the newer model?

识别图像每个循环所用的时间变长

你好,我使用您的模型对一个文件夹下数万张图片进行打标,发现每个for循环的时间比前一次时间会增加,最开始是6s一张,机器跑一个通宵后变成100s一张,我停止程序后立即启动又变成6s,然后一次增加时长。检测程序发现是yolo_model.py中
image耗时较长,请问应该如何解决呢?

Find mistake in code

I found mistake in the code.

File: yolo_model.py

for image with width not equal to height, this lines causes to error (lines 59-63):

        col = np.tile(np.arange(0, grid_w), grid_w).reshape(-1, grid_w)
        row = np.tile(np.arange(0, grid_h).reshape(-1, 1), grid_h)

        col = col.reshape(grid_h, grid_w, 1, 1).repeat(3, axis=-2)
        row = row.reshape(grid_h, grid_w, 1, 1).repeat(3, axis=-2)

instead, copy and paste these lines :

col = np.tile(np.arange(0, grid_w), grid_h).reshape(-1, grid_w)
row = np.tile(np.arange(0, grid_h).reshape(-1, 1), grid_w)
col = col.reshape(grid_h, grid_w, 1, 1).repeat(3, axis=-2)
row = row.reshape(grid_h, grid_w, 1, 1).repeat(3, axis=-2)

the issue of video target detection

@xiaochus hi,xiaochus.when i tested the video with my own trained model,i couldn't identify anything;instead,i could identify if i used the author's yolov3.weights.i dont know why this result was produced,cause when i use my trained model on darknet,it worked well.

Some issues about box decode

I found that you use:
col = np.tile(np.arange(1, grid_w + 1), grid_w).reshape(-1, grid_w)
row = np.tile(np.arange(1, grid_h + 1).reshape(-1, 1), grid_h)

It means you use offsets of [1, W] and [1, H], But why you not use [0, W-1] and [0, H-1]?

there is a bug in darknet53.py

Good work!
But I think there is a bug in darknet53.py, line 51:
in stead of x = conv2d_unit(inputs, 2 * filters, (3, 3)), it shoud be x = conv2d_unit(x, 2 * filters, (3, 3)).
Can you check it?

ValueError: Error when checking :

how to solve this ??????

ValueError: Error when checking : expected input_1 to have shape (608, 608, 3) but got array with shape (416, 416, 3)

Object detection on video frames take soo long.

I am using this repo to run YoloV3 on a test video. My GPU support is GeForce GTX 1080 Ti. The video is playing with almost 3 sec per frame. I have no idea why it is so slow, even though my GPU is good enough. I have attached a screen-shot of my terminal while running the test video. Any idea or guidance is much appreciated. Thank You

imgpsh_fullsize

我看完代码了,感觉这是个假的YOLOv3

这个repo只有detection功能,那么怎么实现这个功能的呢?
写的一堆yolo model代码一点没用到,他只是用别人写好的yad2k.py文件把darknet.weight文件转成keras的.h5文件,然后load_model,就开始其实就是用训练好的模型,predict然后完事了。
所以我觉得没必要再看了,没有train功能,前面star的不知道真的看没看。

Value Error

I found an error in this code. I am looking forward to the author's reply thanks
File "demo.py", line 152, in
image = detect_image(image, yolo, all_classes)
File "demo.py", line 90, in detect_image
boxes, classes, scores = yolo.predict(pimage, image.shape)
File "C:\Users\Administrator\Desktop\YOLOv3-master\model\yolo_model.py", line 209, in predict
boxes, classes, scores = self._yolo_out(outs, shape)
File "C:\Users\Administrator\Desktop\YOLOv3-master\model\yolo_model.py", line 158, in _yolo_out
b, c, s = self._process_feats(out, anchors, mask)
File "C:\Users\Administrator\Desktop\YOLOv3-master\model\yolo_model.py", line 54, in _process_feats
box_wh = box_wh * anchors_tensor
ValueError: operands could not be broadcast together with shapes (13,13,2) (1,1,3,2)
qq 20181214105101

ImportError: No module named configparser

Hi,I am trying to convert Yolo wieghts to Keras on my Mac but i can't run the script. It says;

Traceback (most recent call last):
File "yad2k.py", line 9, in
import configparser
ImportError: No module named configparser

i tried pip install configparser but it didn't work. Do you have any advise?

Creating the net without yolov3.weights makes it untrainable

Hello,

I'm trying to train a network for different tasks, based on your project. The main issue I have is that if I create the same net with random weights instead of those from yolov3.weights (using this script: https://pastebin.com/RECciwrs) I get a net with the same number of params, the same layers, but on inference it outputs a matrix of NaNs. Since it outputs NaNs, I cannot train it, it will not converge to the desired weights.

How to repro:

  1. Save the script from https://pastebin.com/RECciwrs as create_yolo_from_scratch.py
  2. python yad2k.py cfg\yolo.cfg yolov3.weights data\yolo.h5
  3. python create_yolo_from_scratch.py cfg/yolo.cfg yolo_random_weights.h5
  4. For convenience, resize giraffe.jpg to 416x416 and rename as giraffe416.jpg
  5. Run in terminal:
    python
from keras.models import load_model
import numpy as np
import cv2
yolo = load_model('yolo.h5')
yolo_rw = load_model('yolo_random_weights.h5')
path = 'images/test/giraffe416.jpg'
image = cv2.imread(path)
image = np.array(image, dtype='float32')
image /= 255.
image = np.expand_dims(image, axis=0)
yolo.predict(image)
# will output a matrix of numbers
yolo_rw.predict(image)
# will output a matrix of NaNs
yolo_rw.set_weights(yolo.get_weights())
yolo_rw.predict(image)
# will output a matrix of numbers

Without using yolov3.weights, do you have any advice on how to seed the network so that it's trainable? I want to then use a different config file for a different number of classes in order to train.
Thank you.

Detection accuracy is not equal to darknet

I have used my own weights and configuration file. But while I am testing with new images the darknet can detect 4 objects where keras can detect only 2.
Do you know the reason behind this ?

could not create a dilated convolution forward descriptor

I have the following problem when running "demo.py", could anyone tell me how to solve it?
`
WARNING:tensorflow:From C:\Users\10137\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
C:\Users\10137\Anaconda3\lib\site-packages\keras\engine\saving.py:292: UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually.
warnings.warn('No training configuration found in save file: '
dog.jpg
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/10137/Desktop/learn/python/yolov3_keras/demo.py', wdir='C:/Users/10137/Desktop/learn/python/yolov3_keras')

File "C:\Users\10137\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile
execfile(filename, namespace)

File "C:\Users\10137\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/10137/Desktop/learn/python/yolov3_keras/demo.py", line 152, in
image = detect_image(image, yolo, all_classes)

File "C:/Users/10137/Desktop/learn/python/yolov3_keras/demo.py", line 90, in detect_image
boxes, classes, scores = yolo.predict(pimage, image.shape)

File "C:\Users\10137\Desktop\learn\python\yolov3_keras\model\yolo_model.py", line 212, in predict
outs = self._yolo.predict(image)

File "C:\Users\10137\Anaconda3\lib\site-packages\keras\engine\training.py", line 1169, in predict
steps=steps)

File "C:\Users\10137\Anaconda3\lib\site-packages\keras\engine\training_arrays.py", line 294, in predict_loop
batch_outs = f(ins_batch)

File "C:\Users\10137\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 2715, in call
return self._call(inputs)

File "C:\Users\10137\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 2675, in _call
fetched = self._callable_fn(*array_vals)

File "C:\Users\10137\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1439, in call
run_metadata_ptr)

File "C:\Users\10137\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 528, in exit
c_api.TF_GetCode(self.status.status))

AbortedError: Operation received an exception:Status: 3, message: could not create a dilated convolution forward descriptor, in file tensorflow/core/kernels/mkl_conv_ops.cc:1111
[[{{node conv2d_2/convolution}}]]
`

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.