-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run YoloV3 detections on thousands of images and save outputs? #723
Comments
Using this fork: https://github.com/AlexeyAB/darknet in the file |
Thanks for the reply. does that work with YoloV3 config files? edit: looks like it should, gonna try now! |
@austinmw Yes. |
Thanks. Does this actually save images with bounding boxes overlaid or only save bounding box info into a txt file? Trying to piece the separate detection images into a video as my build is freezing when trying to pass videos |
It only saves bounding box info into a txt file |
Ah ok, happen to know any way to save prediction images like |
@austinmw did you get the way to save the images instead of only text file |
@AlexeyAB I am using darknet fork from the yolo website. I have already trained my model on yolov3 . Now I want to make prediction on a folder . I tried using this |
@surajitkundu29 I didn't find an option directly. One workaround is that it will save bounding boxes over video output. So what you could do is combine your images (if they are the same size) into a video, run detection on the video, then split them back up. |
@worldmovers Try to use this fork for detection: https://github.com/AlexeyAB/darknet |
@AlexeyAB Is there a way to save output images with bounding boxes in a different folder ? |
Mostafa,
Write yourself a little bit of python to call Darknet and you do do
whatever you want with the pictures. Example here:
PeterQuinn925/Squirrel@d514aa2
On Mon, Jul 30, 2018 at 1:49 AM Mostafa Hussein ***@***.***> wrote:
@AlexeyAB <https://github.com/AlexeyAB> Is there a way to save output
images with bounding boxes in a different folder ?
I have a directory with thousands of input images, and I created an
input.txt path for the images, and I am passing them in the command, but
the output is always overriden for each frame on predictions.png
I need to save multiple outputs
what can I do ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#723 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARocJbKTi38A63u87I0E3SvSYVWJcisKks5uLsivgaJpZM4Ten8t>
.
--
Peter Quinn
(415) 794-2264 (cell)
|
@PeterQuinn925 and I am trying to find a way to avoid that here is how I do it |
@mhusseinsh I've forked darknet and implemented an ad-hoc solution that worked for me. If you want to take a look, here's the commit. |
@mhusseinsh import os d = 0 |
hi, i ran that script successfully, in the result.txt file it stores the predicted class of each image in the train.txt and % of the prediction. What if for each prediction. One wants the coordinates of the bounding boxes of the predicted class in the image. |
@AlexeyAB can you please help? |
Hi, |
There is a
Will write the image to |
can you do that for the folder that contains test images =? |
That script also does not worked for me .How did you find a solution to save output of test data ? |
Updated: May 07, 2020 I added the function of exporting the bounding box coordinates and classes names, confidence for each image in an input folder. Now it supports:
Try now: Updated: May 14, 2019 Batch images detection using Yolo on AexeyAB Darknet: I added this function in the source code and resolve this problem with command: Command
Parameter explain:
As AlexeyAB updates frequently, hereby I added a stable version of AlexeyAB Darknet with extra convenient functions into my Github repos. Usage
ContactAny questions please let me know. Best Regards, |
Solved! Please see my answer above. |
Solved! Please see my answer above. |
Solved! Please see my answer above. |
Solved! Please see my answer above. |
I managed to make your solution work but I'm still having some issues with the output! Is there a way to remove the .jpg from input files? Or keep them as jpg when saving I'm currently solving this by running |
Thanks Yddeon, I'll modify on it before next week. |
Hi,
I guess that you want to detect objects from multiple images, correct?
On Fri, 3 Jul 2020 at 15:24, RoshniKoli ***@***.***> wrote:
Using command -
Get-Content | .\darknet.exe detector test .\cfg\Data.data
.\cfg\yolov3_cvfashion_test.cfg .\yolov3_cvfashion_train.backup -dont_show
-ext_output > result_cv.txt
The program runs but i get this error -
[yolo] params: iou loss: mse (2), iou_norm: 0.75, cls_norm: 1.00,
scale_x_y: 1.00
Total BFLOPS 139.683
avg_outputs = 1108870
Loading weights from .\yolov3_cvfashion_train.backup...Done! Loaded 107
layers from weights-file
Cannot load image ????
Cannot load image �
Cannot load image �� ������
The image paths work when I test it one at a time using detector test
command. The same paths as input to above code throw that error. Please
suggest.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#723 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSXEI6DMVUVTVYG6R7A2KTRZXLYDANCNFSM4E32P4WQ>
.
--
Regards,
Vincent X. Gong
|
Yes. |
Try this:
https://darknet.gong.im
It’s made for the batch images detection using Yolo.
On Fri, 3 Jul 2020 at 16:42, RoshniKoli ***@***.***> wrote:
Hi, I guess that you want to detect objects from multiple images, correct?
On Fri, 3 Jul 2020 at 15:24, RoshniKoli *@*.***> wrote: Using command -
Get-Content | .\darknet.exe detector test .\cfg\Data.data
.\cfg\yolov3_cvfashion_test.cfg .\yolov3_cvfashion_train.backup -dont_show
-ext_output > result_cv.txt The program runs but i get this error - [yolo]
params: iou loss: mse (2), iou_norm: 0.75, cls_norm: 1.00, scale_x_y: 1.00
Total BFLOPS 139.683 avg_outputs = 1108870 Loading weights from
.\yolov3_cvfashion_train.backup...Done! Loaded 107 layers from weights-file
Cannot load image ???? Cannot load image � Cannot load image �� ������ The
image paths work when I test it one at a time using detector test command.
The same paths as input to above code throw that error. Please suggest. —
You are receiving this because you were mentioned. Reply to this email
directly, view it on GitHub <#723 (comment)
<#723 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABSXEI6DMVUVTVYG6R7A2KTRZXLYDANCNFSM4E32P4WQ
.
-- Regards, Vincent X. Gong
Yes.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#723 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSXEIZ66THIA4M7THXRU7DRZXU6BANCNFSM4E32P4WQ>
.
--
Regards,
Vincent X. Gong
|
Hi Vincent, I built your project and tried using the batch command. In that command, do I have to specify the path to images folder or a list of paths ? Can you please clarify? Thanks in advance. |
Hi,
You just need to specify the input folder folder and the output folder.
The input folder: a folder contain all images to be detected.
The output folder: the folder that the yolo will save detected images to.
In the web page (https//darknet.gong.im) there is a explanation of each
parameters in the command.
Let me know if you have any questions.
BR, Vincent
On Sat, 4 Jul 2020 at 16:44, RoshniKoli ***@***.***> wrote:
Try this: https://darknet.gong.im It’s made for the batch images
detection using Yolo.
On Fri, 3 Jul 2020 at 16:42, RoshniKoli *@*.*> wrote: Hi, I guess that
you want to detect objects from multiple images, correct? On Fri, 3 Jul
2020 at 15:24, RoshniKoli @.*> wrote: Using command - Get-Content |
.\darknet.exe detector test .\cfg\Data.data .\cfg\yolov3_cvfashion_test.cfg
.\yolov3_cvfashion_train.backup -dont_show -ext_output > result_cv.txt The
program runs but i get this error - [yolo] params: iou loss: mse (2),
iou_norm: 0.75, cls_norm: 1.00, scale_x_y: 1.00 Total BFLOPS 139.683
avg_outputs = 1108870 Loading weights from
.\yolov3_cvfashion_train.backup...Done! Loaded 107 layers from weights-file
Cannot load image ???? Cannot load image � Cannot load image �� ������ The
image paths work when I test it one at a time using detector test command.
The same paths as input to above code throw that error. Please suggest. —
You are receiving this because you were mentioned. Reply to this email
directly, view it on GitHub <#723
<#723> (comment) <#723 (comment)
<#723 (comment)>>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABSXEI6DMVUVTVYG6R7A2KTRZXLYDANCNFSM4E32P4WQ
. -- Regards, Vincent X. Gong Yes. — You are receiving this because you
were mentioned. Reply to this email directly, view it on GitHub <#723
(comment)
<#723 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABSXEIZ66THIA4M7THXRU7DRZXU6BANCNFSM4E32P4WQ
.
-- Regards, Vincent X. Gong
Hi Vincent,
I built your project and tried using the batch command. In that command,
do I have to specify the path to images folder or a list of paths ? Can you
please clarify? Thanks in advance.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#723 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSXEI5CNO222UI5OQ7OFRDRZ456TANCNFSM4E32P4WQ>
.
--
Regards,
Vincent X. Gong
|
@vincentgong7 Sir, Can you help me to get only detected object(Licence plate) only from video? |
I tried that as well, the build on windows went right. But the command darknet.exe is not giving any output. The sample command doesn't execute as well. I am not sure what went wrong. |
Hi, you may find some error messages. Otherwise, consider run your task on
Ubuntu or directly online (Google Colab), which I provide an example and it
works for sure.
Regards,
Vincent X. Gong
…On Sun, Jul 5, 2020 at 3:24 PM RoshniKoli ***@***.***> wrote:
Hi, You just need to specify the input folder folder and the output
folder. The input folder: a folder contain all images to be detected. The
output folder: the folder that the yolo will save detected images to. In
the web page (https//darknet.gong.im) there is a explanation of each
parameters in the command. Let me know if you have any questions. BR,
Vincent
On Sat, 4 Jul 2020 at 16:44, RoshniKoli *@*.**> wrote: Try this:
https://darknet.gong.im <https://darknet.gong.im> It’s made for the batch
images detection using Yolo. On Fri, 3 Jul 2020 at 16:42, RoshniKoli @.>
wrote: Hi, I guess that you want to detect objects from multiple images,
correct? On Fri, 3 Jul 2020 at 15:24, RoshniKoli @.*> wrote: Using
command - Get-Content | .\darknet.exe detector test .\cfg\Data.data
.\cfg\yolov3_cvfashion_test.cfg .\yolov3_cvfashion_train.backup -dont_show
-ext_output > result_cv.txt The program runs but i get this error - [yolo]
params: iou loss: mse (2), iou_norm: 0.75, cls_norm: 1.00, scale_x_y: 1.00
Total BFLOPS 139.683 avg_outputs = 1108870 Loading weights from
.\yolov3_cvfashion_train.backup...Done! Loaded 107 layers from weights-file
Cannot load image ???? Cannot load image � Cannot load image �� ������ The
image paths work when I test it one at a time using detector test command.
The same paths as input to above code throw that error. Please suggest. —
You are receiving this because you were mentioned. Reply to this email
directly, view it on GitHub <#723
<#723> <#723
<#723>> (comment) <#723
<#723> (comment) <#723 (comment)
<#723 (comment)>>>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABSXEI6DMVUVTVYG6R7A2KTRZXLYDANCNFSM4E32P4WQ
. -- Regards, Vincent X. Gong Yes. — You are receiving this because you
were mentioned. Reply to this email directly, view it on GitHub <#723
<#723> (comment) <#723 (comment)
<#723 (comment)>>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABSXEIZ66THIA4M7THXRU7DRZXU6BANCNFSM4E32P4WQ
. -- Regards, Vincent X. Gong Hi Vincent, I built your project and tried
using the batch command. In that command, do I have to specify the path to
images folder or a list of paths ? Can you please clarify? Thanks in
advance. — You are receiving this because you were mentioned. Reply to this
email directly, view it on GitHub <#723 (comment)
<#723 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABSXEI5CNO222UI5OQ7OFRDRZ456TANCNFSM4E32P4WQ
.
-- Regards, Vincent X. Gong
I tried that as well, the build on windows went right. But the command
darknet.exe is not giving any output. The sample command doesn't execute as
well. I am not sure what went wrong.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#723 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSXEI6JQLTQEA775UUHWPTR2B5KPANCNFSM4E32P4WQ>
.
|
Hi,
Sorry, I have not yet worked on the video, please refer to the official
document about detecting objects on videos.
Regards,
Vincent X. Gong
…On Sun, Jul 5, 2020 at 1:21 PM neheteakshay ***@***.***> wrote:
@vincentgong7 <https://github.com/vincentgong7> Sir, Can you help me to
get only detected object(Licence plate) only from video?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#723 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSXEI56XF2YK5Q3SNKSYI3R2BO25ANCNFSM4E32P4WQ>
.
|
What is the data/coco.data for |
you can use this : import os d = 0 images=[]
print(len(images)) |
Hi,
For the detecting images in folder, please try this:
https://darknet.gong.im
There I provide instructions and online demo. Should be easy for you.
Let me know if you have any questions.
BR,
Vincent
On Fri, 31 Jul 2020 at 18:28, murari2401 ***@***.***> wrote:
@AlexeyAB <https://github.com/AlexeyAB> I am using darknet fork from the
yolo website. I have already trained my model on yolov3 . Now I want to
make prediction on a folder . I tried using this
./darknet detector test data/voc.data yolo-voc.cfg yolo-voc.weights
-dont_show < data/train.txt > result.txt
but that's not working. Can you please help me
import os
import glob
import cv2
#os.system
import time
import PIL
import PIL.Image as Image
d = 0
test_Path = r"E:\yolo_v4\darknet\build\darknet\x64\c910"
images=[]
for filename in os.listdir(test_Path):
img=cv2.imread(os.path.join(test_Path,filename))
if img is not None:
images.append(img)
commands = ['darknet.exe detector test data/objc.data cfg/yolov3-objc.cfg backup3/yolov3-objc_last.weights -dont_show', os.path.join(test_Path,filename)]
os.system(' '.join(commands))
predicted_image = Image.open("E:\\yolo_v4\\darknet\\build\\darknet\\x64\\predictions.jpg")
output = "E:/yolo_v4/darknet/build/darknet/x64/c910r/"+str(filename)
predicted_image.save(output)
d+=1
print(len(images))
print(d)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#723 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSXEI7XODOFBECYHVGGPK3R6LWJPANCNFSM4E32P4WQ>
.
--
Regards,
Vincent X. Gong
|
I Have given a input image and YOLOv3 gace output with bouding boxes. I tried to subtract input and output image then I observed yolo is modifying most of pixels in output .(When I have subtracted input and output images I should only get bounding box but instead I got much noisy image in output) |
This works well. Here I have modified to save your predicted images based on the exact filename of your original image. This code also runs on Google Colab. import os test_Path = r'build/darknet/x64/data/test' |
Where in the code will i be able to extract the recognized class as word or hex to transfer it on the fly to my python lora python code? |
Hi,
You can export the detect result as json or text and then use python to
parse them.
Regards,
Vincent X. Gong
…On Mon, Nov 9, 2020 at 8:13 PM Panagiotis ***@***.***> wrote:
Where in the code will i be able to extract the recognized class as word
or hex to transfer it on the fly to my python lora python code?
Instead of say hello world over the lora i would like to transfer the
detected objects, which of them or the number of them if i'll be able to
count the same class object
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#723 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSXEI6E7XWPL3UHOL43AQ3SPA5OHANCNFSM4E32P4WQ>
.
|
Thanks Vincent, what im currently using is the Darknet-NNPACK for an SBC. How can effectively extract those JSON or .txt as happens in your repo? Then i will be able to write a python parser code. |
Is there an example in python on how to print how many boats and how many persons of this JSON example: Used something like that but getting blanks |
This does not work for me. I get the following error
|
|
Hi @paulaceccon , I tried the command on my custom dataset: But I am getting blank result.json while I am getting correct output Also getting below error at end, is it stopping to put the output in json file ? I am stuck with it from last 2 days. Please help |
What worked for me was:
|
Hi @paulaceccon @rk8650 @pentanol2 |
AlexeyAB#7276 this might help |
Hi,
Sorry I have not yet looked into detecting objects in video using Yolo.
Maybe others with such experiences can help.
Regards,
Vincent X. Gong
…On Tue, Feb 9, 2021 at 7:07 AM Shubham Shah ***@***.***> wrote:
@vincentgong7 <https://github.com/vincentgong7> Sir, Can you help me to
get only detected object(Licence plate) only from video?
AlexeyAB#7276 <AlexeyAB#7276> this
might help
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#723 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSXEIYNLRSZYBQLVRVACQTS6DGKLANCNFSM4E32P4WQ>
.
|
Did some changes but works good. thankyou.... |
Hello, I struggled with batch inferring for some time and would like to share my solution. It is a python script to be run after running darknet for predictions so that images will be modified from a log text file. See more inside the very script. It is not perfect but it is quick and easy to use. Cheers! |
|
Hi guys I made an python script that runs efficiently with any GPU if you have a big weights file it runs the detection and saves it on excel with time stamp and confidence you can also use live detection and save it in Excel file refer this youtube link please subscribe to appreciate my work I have done it elegantly its. Simple even you don't understand the language just watch the video and try it and you can also do it for images follow me on youtube I can guide you here is the link and code it's given in description for free |
how to hide confidence score on predicted image on yolov2? |
I've only figured out how to run detections on one image at a time, typing a new image filename each time. Is there any build-in way to run on an entire folder of images and save images with predictions to another folder?
The text was updated successfully, but these errors were encountered: