xslittlegrass / carnd-vehicle-detection Goto Github PK
View Code? Open in Web Editor NEWVehicle detection using YOLO in Keras runs at 21FPS
Vehicle detection using YOLO in Keras runs at 21FPS
Hi,
I was having a look at the YOLO V1 website https://pjreddie.com/darknet/yolov1/. It says the tiny-yolo.weights
file should be around 103 MB. The link provided by you the readme is about 180 MB. Why are these weight files different?
Also you have provided a reference to https://github.com/sunshineatnoon/Darknet.keras
in your utils file. The model architecture in that repository seems to be different than yours, both are supposed to be for YOLO v1. The Darknet.keras
repo doesn't have leaky relu after every convolutional layer, but yours does. Why is that so?
Thanks,
Subodh
FileNotFoundError Traceback (most recent call last)
in ()
2
3
----> 4 load_weights(model,'./yolo-tiny.weights')
/anaconda3/lib/python3.6/site-packages/utils/utils.py in load_weights(model, yolo_weight_file)
9 def load_weights(model,yolo_weight_file):
10
---> 11 data = np.fromfile('yolo_weight_file',np.float32)
12 data=data[4:]
13
FileNotFoundError: [Errno 2] No such file or directory: './yolo-tiny.weights'
Please help me to sort the issue. Thanks
Hi, Good Job
I want to train this model from scratch to detect traffic signs instead of cars.
How should i prepare my dataset and steps by this model.
secondly, the model is wonderful, but the output vector is some strange.
assume i want to crop the detected object to classify it.
how will i do that?
thanks in advance
Traceback (most recent call last):
File "detect.py", line 69, in <module>
ax2.imshow(draw_box(boxes,image,[[500,1280],[300,650]]))
.../utils/utils.py", line 105, in draw_box
left = int ((b.x - b.w/2.) * w)
ValueError: cannot convert float NaN to integer
Did anyone get this error? How did you fix it?
there are some problems on re-train this network, would you post your method?
Hi,
I tried to reproduce you result but I found the yolo-tiny weight is not working.. Can you show me where you get the weights?
Best,
Henry
When I am running the code, I recieve the following error-
File "C:\Users\in0131\Downloads\CarND-Vehicle-Detection-master\CarND-Vehicle-Detection-master\utils\utils.py", line 21, in load_weights
ker = data[index:index+np.prod(kshape)].reshape(kshape)
ValueError: cannot reshape array of size 136269 into shape (3,3,1024,1024)
Any idea on how to proceed?
Hi,
I got an issue with the utils library:
from utils import load_weights, Box, yolo_net_out_to_car_boxes, draw_box
It doesn't seem this library is from Keras. Can you help where to find it
Thanks
/Said
The new API of any Keras version bigger than 2.0 seems to lead to unconnected networks. No error of any kind can be seen apart from that the model.summary() will not show any "Connected to" entry and the network will not find any vehicle.
Downgrading to version 1.2.2. resolves the issue.
Thanks for the great work creating this, I would fix the issue myself though I am not yet familiar enough with Keras and do not yet know how.
I try to run this demo ,but I got a ValueError:can not convert float NaN to integer,i have download de weights
how can i fix it,ples,thx
in ()
----> 1 load_weights(model,'./tiny-yolo-voc.weights')
in load_weights(model, yolo_weight_file)
15 bia = data[index:index+np.prod(bshape)].reshape(bshape)
16 index += np.prod(bshape)
---> 17 ker = data[index:index+np.prod(kshape)].reshape(kshape)
18 index += np.prod(kshape)
19 layer.set_weights([ker,bia])
ValueError: cannot reshape array of size 136269 into shape (3,3,1024,1024)
i try to run your code , but it shows something error, i have no idea how to fix it . can you help me ,please?
After running the script there found no bounding boxes in the output video file.Same as the input source video,tried tweaking with the threshold but no luck in that.
And the boxes variable returns an empty list.
In the load_weights
function in utils.py file, there is this line which does:
data=data[4:]
This ignores the first three values of the loaded weights array.
Can someone please tell why do we need to do this?
I downloaded the weights from http://pjreddie.com/media/files/yolo-tiny.weights
but after I run the script, no bounding boxes are seen on the test images.
@xslittlegrass Thanks for sharing your codes. It seems that you load the weights provided by YOLO team and constructs a tiny YOLO model with Keras and then predict images with feedforward pass. What if I want to train with my own dataset, i.e. object not included with YOLO training data, iPhone, iPad, etc.
the load function is showing the following error -
ker = data[index:index+np.prod(kshape)].reshape(kshape)
ValueError: cannot reshape array of size 443769 into shape (3,3,1024,1024)
Can you please help?
ValueError Traceback (most recent call last)
in ()
----> 1 load_weights(model,'./yolo-tiny.weights')
2 print("load_weights succeed")
E:\github\xslittlegrass-CarND-Vehicle-Detection\utils\utils.py in load_weights(model, yolo_weight_file)
21 size = np.prod(kshape)
22 print("kshape: {} data:{} - {}".format(kshape, data.shape, size))
---> 23 ker = data[index:index+size].reshape(kshape)
24 index += np.prod(kshape)
25 layer.set_weights([ker,bia])
ValueError: cannot reshape array of size 443769 into shape (3,3,1024,1024)
Hello, @xslittlegrass
I am getting an error when i convert the ipynb file to py file using nbconvert. I am using Python 3.6 on windows 10 with all the necessary packages installed. Can you help me with this? Here is the error:
File "vehicle detection.py", line 163, in
'exec(%matplotlib.agg inline)'('time', 'lane_clip.write_videofile(project_video_output, audio=False)')
TypeError: 'str' object is not callable
Fatal Python error: PyImport_GetModuleDict: no module dictionary!
Current thread 0x00002d58 (most recent call first):
File "C:\Users\rohit\AppData\Local\Programs\Python\Python36\lib\site-packages\moviepy\video\io\VideoFileClip.py", line 116 in del
Thanks in advance.
In draw box function in utils.py, error starting from line 105. "Can't convert float nan to integer "
Hi
I want to detect only vehicle(car,bus,truck,motorbyce) in real time
is this a way to load the pretrained weights of this model and train on my own dataset?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.