leonlok / deep-sort-yolov4 Goto Github PK
View Code? Open in Web Editor NEWPeople detection and optional tracking with Tensorflow backend.
License: GNU General Public License v3.0
People detection and optional tracking with Tensorflow backend.
License: GNU General Public License v3.0
the video output cannot open and is only 6kb
Hi I am testing you project and everything seems to work fine.
My question is that I only see CPU usage (around 75%) and almost nothing GPU (4%) is that correct?
My HW
Ubuntu 20.04
Intel i5
Nvidia GTX 2060 8 GB
Only get 1 FPS
Thanks in advance
The README of your code, it shows thatby changing the detection for person and car, I want to ask that is it need to retrain the deepsort model for tracking both person and car? or it just work on both classes?
I don't really understand the [self.boxes, self.scores, self.classes]
in self.generate()
.
My purpose is to use yolo4.pb to do some prediction just in tensorflow, but here [self.boxes, self.scores, self.classes]
do some tricks in keras and I don't know how to do this exchange using yolo4.pb.
out_boxes, out_scores, out_classes = self.sess.run( [self.boxes, self.scores, self.classes], feed_dict={ self.yolo_model.input: image_data, self.input_image_shape: [image.size[1], image.size[0]] # K.learning_phase(): 0 })
Thanks for the coming help!
I use amir-abdi/keras_to_tensorflow convert the yolo4.h5 to yolo4.pb. The format of outputs are different compared to using yolo4.h5.
platforrm:tensorflow1.14
from sklearn.utils.linear_assignment_ import linear_assignment causes no linear_assignment error,
using from scipy.optimize import linear_sum_assignment as linear_assignment insteads,but new error occurs:
Traceback (most recent call last):
File "demo.py", line 144, in
main(YOLO())
File "demo.py", line 103, in main
tracker.update(detections)
File "D:\Deep-SORT-YOLOv4-master\tensorflow1.14\deep-sort-yolov4\deep_sort\tracker.py", line 69, in update
self._match(detections)
File "D:\Deep-SORT-YOLOv4-master\tensorflow1.14\deep-sort-yolov4\deep_sort\tracker.py", line 127, in _match
detections, iou_track_candidates, unmatched_detections)
File "D:\Deep-SORT-YOLOv4-master\tensorflow1.14\deep-sort-yolov4\deep_sort\linear_assignment.py", line 64, in min_cost_matching
if col not in indices[:, 1]:
TypeError: tuple indices must be integers or slices, not tuple
WARNING:tensorflow:From D:\Documents\Downloads\Compressed\Deep-SORT-YOLOv4-master\tools\generate_detections.py:80: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.
Traceback (most recent call last):
File "demo.py", line 143, in
main(YOLO())
File "demo.py", line 73, in main
boxes, confidence, classes = yolo.detect_image(image)
File "D:\Documents\Downloads\Compressed\Deep-SORT-YOLOv4-master\yolo.py", line 96, in detect_image
K.learning_phase(): 0
File "D:\ProgramData\Anaconda3\envs\tf14_gpu\lib\site-packages\tensorflow\python\client\session.py", line 950, in run
run_metadata_ptr)
File "D:\ProgramData\Anaconda3\envs\tf14_gpu\lib\site-packages\tensorflow\python\client\session.py", line 1149, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (1, 416, 416, 3) for Tensor 'input_1:0', which has shape '(?, 608, 608, 3)'
(tf14_gpu) PS D:\Documents\Downloads\Compressed\Deep-SORT-YOLOv4-master>
Hi,
I've tried to use your convert.py to convert my ownl model to a h5 model but i get:
ValueError: Layer weight shape (3, 3, 32, 64) not compatible with provided weight shape (3, 3, 32, 32)
Any ideas?
I've set my cfg file, my own trained weights file and my classes file correctly in convert.py.
I've trained my model with alexeyab/darknet v4 in 608 size (which i've also set correctly in convert.py)
Hi!
The convert.py is not working on my side. Could you please share your converted keras .h5 model?
I send a traffic video, and change class to car, but nothing is detected.
convert.py, line 128, in load_yolo
conv_weights = np.ndarray(
TypeError: buffer is too small for requested array
Hello i changed my custom trained weight file inti .h5 file and then run the python demo.py - i get this error. anybody having any idea about this ?
InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 81120 values, but the requested shape requires a multiple of 689520
[[node Reshape_15 (defined at /home/tubo/anaconda3/envs/yolo/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:2440) ]]
[[node boolean_mask_147/GatherV2 (defined at /home/tubo/YOLOv4/tensorflow2.0/deep-sort-yolov4/yolo4/model.py:279) ]]
Demo.py cannot run with Tiny model.
Hi,
1-There is an error while converting tiny_yolov4.weights to tiny_yolov4.h5. Do we need to make some changes? i have tried to change convert.py for anchors etc but still not working.
2- If we got tiny_yolov4.h5, can we run using the same settings or we still need to make changes?
3-The speed for yolov4 is very slow, it's 0.62 FPS on GTX 1080 Ti. what is the reason?
When I am running yolo.py for tracking with my custom keras model, I am getting following error:
main(YOLO())
File "/home/unizen/Deep-SORT-YOLOv4/tensorflow1.14/yolo.py", line 30, in __init__
self.boxes, self.scores, self.classes = self.generate()
File "/home/unizen/Deep-SORT-YOLOv4/tensorflow1.14/yolo.py", line 51, in generate
self.yolo_model = load_model(model_path, custom_objects={'Mish': Mish}, compile=False)
File "/home/unizen/anaconda3/lib/python3.7/site-packages/keras/engine/saving.py", line 419, in load_model
model = _deserialize_model(f, custom_objects, compile)
File "/home/unizen/anaconda3/lib/python3.7/site-packages/keras/engine/saving.py", line 221, in _deserialize_model
model_config = f['model_config']
File "/home/unizen/anaconda3/lib/python3.7/site-packages/keras/utils/io_utils.py", line 302, in __getitem__
raise ValueError('Cannot create group in read only mode.')
ValueError: Cannot create group in read only mode.
This might be due to the different yolo_anchors.txt for my model. Do you have any idea of generating anchors for custom yolo model
When i run this code with tensorflow-cpu 2.4 ,the result is diffrent from tensorflow-gpu 2.3. How can I change the code and run it with tensorflow-cpu?
Hi,
Thanks for your great work, I want to know if your repo support multi-gpu(It seems to be not). Can you add multi-gpu code?
RT, thank you very much !
Hello, dear contributers. I installed all dependencies from your requirments.txr manually(because I have windows), but I have got I lot of version incompatibilities (with keras, tensorflow). Please, could you send me all actual versions of your dependencies you use today.
Best regards, Yurii Vavrynchuk
Hi.
I'm using Tensorflow 2.0.0 version and I had some problems with convert.py
At every line with np.ndarray(shape=(1,), dtype='int32') #buffer=weights_file.read(4)
I obtained the following error:
TypeError: buffer is too small for requested array
.
So I removed the buffer option in every nd.array line and it worked.
Now if I run demo.py I have no detections.
So why does videocaptureasync.py
have NoneType? And how to fix this error? While running asynchronous mode it kind of works and goes through while
loop in demo.py
. From the image below demo.py
goes through while
loop 42 times and then has an error. I found a link that talked about this error but unable to fix the error currently.
https://github.com/alievk/avatarify/issues/67
when you run the problem may hapeen 'No module named ´sklearn.utils.linear_assignment'.you should change your sklearn version with command 'pip install scikit-learn==0.19'. the 'Dependencies' should add the 'sklearn' version informaintion
Hi,
I have worked on training yolo-custom.weights with my own dataset. I took the mode(yolo-obj_1000.weights) when it finished 1000 iterations and tried to convert it to yolo-obj_1000.h5.
But I am getting the following error:
File "convert.py", line 171, in <module>
yolo4_model = Yolo4(score, iou, anchors_path, classes_path, model_path, weights_path)
File "convert.py", line 157, in __init__
self.load_yolo()
File "convert.py", line 98, in load_yolo
buffer=weights_file.read(weights_size * 4))
TypeError: buffer is too small for requested array
also while testing my custom model yolo-obj_1000.weights, I am getting good results for images and videos
When i edit gpus=4
in convert.py, line 169 it occurs error like this.
Traceback (most recent call last):
File "convert.py", line 172, in
yolo4_model = Yolo4(score, iou, anchors_path, classes_path, model_path, weights_path, gpus)File "convert.py", line 157, in init
self.load_yolo()File "convert.py", line 142, in load_yolo
self.yolo4_model = multi_gpu_model(self.yolo4_model, gpus=self.gpu_num)NameError: name 'multi_gpu_model' is not defined
I can't find "multi_gpu_model" everywhere..
How can i solved?
Hi, I'm trying to find last location of tracked object on IP Camera with adding object id and tracked loc taked from to_tlbr() function than grouped locations according to id's and access last location of the object according to the id. Because its leave and last loc always updated I do not handle with this problem. Could you guide me please, I'm lost :)
Thanks for your time..
Fail to convert tiny version, any help for it? thanks
Hi
I have a problem when converting my model to a .h5 file using the convert file. I had no problems converting from a model trained with yolov4 so I'm guessing there's some value that i need to change in order to be able to convert my file. I'm using the corresponding .txt and weights files for each model so I'm sure that's not the issue. BTW I'm getting this error with the csp model:
.
.
.
Converting 104
Traceback (most recent call last):
File "convert.py", line 171, in
yolo4_model = Yolo4(score, iou, anchors_path, classes_path, model_path, weights_path)
File "convert.py", line 157, in init
self.load_yolo()
File "convert.py", line 130, in load_yolo
buffer=weights_file.read(weights_size * 4))
TypeError: buffer is too small for requested array
Thanks and regards!
Hi,
I have trained new dataset with 3 labels and obtained custom yolov3 keras model. Do u Know how to apply it for tracking?.
Kindly do reply @LeonLok
mon problème moyen est cette erreur si j'exécute python convert.py. aide moi s'il te plait
Traceback (dernier appel le plus récent):
Fichier "convert.py", ligne 172, dans
yolo4_model = Yolo4 (score, iou, anchors_path, classes_path, model_path, weights_path)
Fichier "convert.py", ligne 158, dans init
self.load_yolo ()
Fichier "convert.py", ligne 128, dans load_yolo
conv_weights = np.ndarray (
TypeError: le tampon est trop petit pour le tableau demandé
Hey I was testing your code and its weird but it seems to run with half of the speed of other implementation witch uses YOLOv3 with tensorflow. I don't know if I am doing something wrong but YOLOv3 manages to run 1.4FPS on CPU and 7FPS on GPU but this implementation runs around 0.6FPS on CPU and 3 FPS on GPU. I value boost in accuracy but damn, it works so slow.
It's line 29
in file tensorflow2.0/deep-sort-yolov4/yolo.py
.
self.sess = tf.compat.v1.keras.backend.get_session()
How to initialize the session if I change this line to:
self.sess = tf.Session()
@LeonLok
Hi,
Since, I am getting error when I am converting yolo custom model(trained with my dataset) to keras model like this:
File "convert.py", line 173, in <module>
yolo4_model = Yolo4(score, iou, anchors_path, classes_path, model_path, weights_path)
File "convert.py", line 157, in __init__
self.load_yolo()
File "convert.py", line 98, in load_yolo
buffer=weights_file.read(weights_size * 4))
TypeError: buffer is too small for requested array
I tried converting using this code:
https://github.com/Runist/YOLOv4/blob/master/utils/convert.py
It is successful, But I am unable to track with that keras-model when I am using demo.py .
If you don't mind, Could you go through the both codes and check where it is wrong
Hi Leon!
Thank you for the great work. I couldn't find a way to extract tracking output if YOLO didn't detect the object.
In other words, I want to get bounding box output from DeepSort where if there isn't any detection output for that specific frame, Deepsort didn't output a b-box for that frame.
Is there a way to do this, interfere with the tracking process, and get a predicted bounding box output?
Thanks in advance.
Thanks for this work,
How can i do asynchronous mode with two cams in the same time??
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.