theaiguyscode / yolov4-cloud-tutorial Goto Github PK
View Code? Open in Web Editor NEWThis repository walks you through how to Build and Run YOLOv4 Object Detections with Darknet in the Cloud with Google Colab.
This repository walks you through how to Build and Run YOLOv4 Object Detections with Darknet in the Cloud with Google Colab.
Hi everyone,
I have been training a model with 6 classes for a max_batches=12000, in my drive I can't find the weights saved after every 1000 iterations, (for example 1000,2000,3000 ...), I can only find in my drive best.weights and final.weights.
How can I have the weights after every 1000 iterations? and what is best.weights, I know that final.weights is the weights updated after 100 iterations?
Thank you
Hi , I want to determine mAP value ( using pre-trained weights and config file) for an image as well as for a video and below is the command I am using to do that .
!./darknet detector map cfg/coco.data cfg/yolov4.cfg /content/drive/My\ Drive/Colab\ Notebooks/yolov4.weights
However it throws out an error "Couldn't open file: data/train.txt" .Here I am NOT doing training .
PFA (coco.data) file
coco.zip
I have followed all the steps and mounted the drive properly hence gdrive appears on the file manager tab. However, while training I have followed the mydrive/yolov4/backup in both obj.data and created the folders in the drive but the trained weights are not saved. If I load a weights file/pre trained weights it can load it properly and resume training but it does not save the weights after 100 iterations.
I have 850 different objects to detect and I am thinking using YOLO to solve this problem. but as you know default yolo algorithm works on 80 different objects.
has any one used yolo to detect objects which is number is more than 80? and how did it well?
Instead of Yolov3, they all download the latest version of darknet, but all you do is change the cfg file you use?
Also are these people https://github.com/ultralytics/yolov5 developing yolo indepently, is it like a fork?
sorry, so many questions.
In case when the colab gets disconnected in the middle of the training, all the files in the VM are lost (such as the darknet folder). Does this mean that I will have to clone the darknet repo and upload all the other pre-requisite files (images, labels, etc) again to start the training?
If yes, would it be helpful to also backup the darknet folder with the gdrive (in addition to the weights file)?
Hey, I followed your video and tried to implement on multiple classes, but turns out after training also there was only one class in the weights that I downloaded. I have made all the changes that were explained in your video. Can you help me with the same?
hi,
how do i pass file name in the below command instead of hardcoding the file name to read multiple images at once
!./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights -ext_output -dont_show -out result.json < /mydrive/images.txt
Instead of hardcoding this "/mydrive/images.txt" filename i want to pass it through code.images.txt may change. Please help me understanding this command
how to show graphs in tensorboard when running this code?
stop while training
error code :
truth.x = 0.958938, truth.y = 0.088214, truth.w = 0.084190, truth.h = 0.134353, class_id = -1
Warning: in txt-labels class_id=-1 >= classes=4 in cfg-file. In txt-labels class_id should be [from 0 to 3]
truth.x = 0.958938, truth.y = 0.088214, truth.w = 0.084190, truth.h = 0.134353, class_id = -1
Warning: in txt-labels class_id=-1 >= classes=4 in cfg-file. In txt-labels class_id should be [from 0 to 3]
truth.x = 0.958938, truth.y = 0.088214, truth.w = 0.084190, truth.h = 0.134353, class_id = -1
Warning: in txt-labels class_id=-1 >= classes=4 in cfg-file. In txt-labels class_id should be [from 0 to 3]
truth.x = 0.958938, truth.y = 0.088214, truth.w = 0.084190, truth.h = 0.134353, class_id = -1
Warning: in txt-labels class_id=-1 >= classes=4 in cfg-file. In txt-labels class_id should be [from 0 to 3]
truth.x = 0.958938, truth.y = 0.088214, truth.w = 0.084190, truth.h = 0.134353, class_id = -1
Warning: in txt-labels class_id=-1 >= classes=4 in cfg-file. In txt-labels class_id should be [from 0 to 3]
truth.x = 0.958938, truth.y = 0.088214, truth.w = 0.084190, truth.h = 0.134353, class_id = -1
Warning: in txt-labels class_id=-1 >= classes=4 in cfg-file. In txt-labels class_id should be [from 0 to 3]
truth.x = 0.958938, truth.y = 0.088214, truth.w = 0.084190, truth.h = 0.134353, class_id = -1
Buffered data was truncated after reaching the output size limit.
Hi @theAIGuysCode , when we run a Terminal code as ./darknet detect .................
and detect a saved image, it is all manually. With a Keras/Tensorflow/ PyTorch model
, we can use Flask
to serve on local system. I am asking is there any way to use this one (Not the Tensorflow one which you have) ? Can I convert this as Python code?
I'm attempting to train my Yolo object detector using the Darknet CNN. I'm using Yolov4 pre-trained weights which as you showed can predict Cars, Traffic Lights, and Stop Signs with these COCO Classes. Just wondering how I can add an extra layer so my model can also pick up Traffic Signs. Code below to train:
!./darknet detector train data/obj.data cfg/yolov4-obj.cfg yolov4.conv.137 -dont_show -map
am using the following command in object detection
!./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights -ext_output -dont_show data/horses.jpg -out result.json
I get the following console output ,
data/horses.jpg: Predicted in 32.813000 milli-seconds.
horse: 77% (left_x: -1 top_y: 189 width: 157 height: 202)
horse: 98% (left_x: 3 top_y: 188 width: 312 height: 224)
horse: 90% (left_x: 249 top_y: 198 width: 171 height: 166)
horse: 86% (left_x: 369 top_y: 210 width: 87 height: 113)
horse: 100% (left_x: 432 top_y: 213 width: 163 height: 13
`5)
but the json file output is more as follows
[
{
"frame_id":1,
"filename":"data/horses.jpg",
"objects": [
{"class_id":17, "name":"horse", "relative_coordinates":{"center_x":0.664307, "center_y":0.547429, "width":0.210341, "height":0.263563}, "confidence":0.996012},
{"class_id":17, "name":"horse", "relative_coordinates":{"center_x":0.205768, "center_y":0.585460, "width":0.404084, "height":0.437523}, "confidence":0.981816},
{"class_id":17, "name":"horse", "relative_coordinates":{"center_x":0.433081, "center_y":0.548049, "width":0.221746, "height":0.324552}, "confidence":0.901274},
{"class_id":17, "name":"horse", "relative_coordinates":{"center_x":0.533728, "center_y":0.519726, "width":0.112260, "height":0.220399}, "confidence":0.861711},
{"class_id":17, "name":"horse", "relative_coordinates":{"center_x":0.100395, "center_y":0.566308, "width":0.203570, "height":0.393987}, "confidence":0.768916}
]
}
]
Is there a way to get the absolute value of the co-ordinates ?
Hi, AI guy, i am training my custum dataset with two class : bike-rider and motor-rider with colab, link is at below
https://colab.research.google.com/drive/1jxEP1ia3oDYf3XvT7NhtfMYly-btW-PB?usp=sharing
but from the training log, i find it is abnormal(.5R & .75R almost = 0), could you take a look ? Thank !
cfg : https://drive.google.com/file/d/1__jNbKO0iLowJjkKfQXC2ql5C90E7bpH/view?usp=sharing
data : https://drive.google.com/file/d/1F1cwJZLRGSCux7IDukINRmD-XnypHna2/view?usp=sharing
names : https://drive.google.com/file/d/1F1cwJZLRGSCux7IDukINRmD-XnypHna2/view?usp=sharing
dataset : https://drive.google.com/file/d/1x52U31sVQXbFO2FM2nyC5GmtwVKiXu09/view?usp=sharing
https://drive.google.com/file/d/1oaC5QckOQeFZaNHrpi0CtzkjkHUWIFUz/view?usp=sharing
hi everyone i'm currently having a problem like this. when i try to run
!python generate_train.py
!python generate_test.py
Traceback (most recent call last):
File "generate_train.py", line 4, in
os.chdir(os.path.join("data", "obj"))
FileNotFoundError: [Errno 2] No such file or directory: 'data/obj'
how to solve this problem. eventho all my files name are correct.
I generated 3,000 synthetic images of rectangles (only one class, class="0"), along with 3,000 label files ("*.txt") that I think are appropriate. The training loss went from 11,000 down to 0.004 over about an hour. I let it go on another hour to 0.000025 loss. I figured I was vastly overtraining -- but I need to see this network do something -- anything. Unfortunately, it cannot detect anything from even my training set:
Loading weights from /mydrive/yolov4/backup/yolov4-obj_final.weights...
seen 64, trained: 32 K-images (0 Kilo-batches_64)
Done! Loaded 162 layers from weights-file
calculation mAP (mean average precision)...
Detection layer: 139 - type = 28
Detection layer: 150 - type = 28
Detection layer: 161 - type = 28
1000
detections_count = 0, unique_truth_count = 0
class_id = 0, name = Box, ap = 0.00% (TP = 0, FP = 0)
for conf_thresh = 0.25, precision = -nan, recall = -nan, F1-score = -nan
for conf_thresh = 0.25, TP = 0, FP = 0, FN = 0, average IoU = 0.00 %
I assume now that the weights are being trained down to 0.000, but I thought the MISH activation was supposed to prevent this. Any words of wisdom? Are there any applications consistent with YoloV4 that can read an image file and label info and produce a picture with a drawn bounding box so that I know my annotation files are constructed properly? I have the x,y, w,h normalized between {0,1} with regards to the image width and height. Maybe my image SNR is too low (these are synthesized for very dark conditions)?
i facing a unknown error after run this command
!./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/person.jpg
ERROR
CUDA status Error: file: ./src/dark_cuda.c : () : line: 39 : build time: Jun 1 2020 - 01:52:37
CUDA Error: no CUDA-capable device is detected
CUDA Error: no CUDA-capable device is detected: Success
darknet: ./src/utils.c:326: error: Assertion
0' failed`
plz help to solve it
Hi @theAIGuysCode, can I please get your License Plate Detector pretrained weights. I also need to train a License Plate Detector for different plates, and would need your weights for transfer learning to hasten up training
In case of training for multiple custom objects, after preparing the labelled data and generating the txt files, should all the images and txt files be compressed in a single folder?
Does the above instruction mean that for class=1, we are to change filters to 18 in the three conv layers before each YOLO layer? Or does it mean we are to change filters to 18 in the last conv layer before each of the three YOLO layers.
Hey there,
Thanks for the tutorial. I would like to first train the Yolo with large dataset relevant to my target class and then do transfer learning with with small dataset as the target class.
In the description, the yolov4.conv.137 which trained with coco dataset is given for doing transfer learning. Would U please help me, how can I remove the output layer of initial trained yolo of my own and get only yolo.conv weights like the given one?
Best
Hi,
I am getting an error:
Wrong annotation: class_id = 1. But class_id should be [from 0 to 0]
I have 1class and all txt files starts with 1.
Hello!
Recently watched your video, started to do everything according to your guide, however training stage just finishes, no new weights config appear after that, I just start that block, it begins to work and then finishes and it's written done. I have no idea what does it mean, because I've already used this notebook to train traffic signs custon detector and everything worked brilliantly. Now I've tried to make custom planes detector, there're 2 classes there and this problem appeared.
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.