pjreddie / darknet

Convolutional Neural Networks

Home Page:http://pjreddie.com/darknet/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run YoloV3 detections on thousands of images and save outputs?

austinmw opened this issue · comments

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?

Using this fork: https://github.com/AlexeyAB/darknet
you can use this command:
./darknet detector test data/voc.data yolo-voc.cfg yolo-voc.weights -dont_show < data/train.txt > result.txt

in the file data/train.txt you should have paths to images
in the file result.txt will be results of detections

Thanks for the reply. does that work with YoloV3 config files? edit: looks like it should, gonna try now!

@austinmw Yes.
For Yolo v3:
./darknet detector test ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights -dont_show < data/train.txt > result.txt

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 ./darknet detect only with multiple images?

@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
./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

@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 ?
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 ?

@PeterQuinn925
I already did a little bash, which performs the images one by one, but the problem which i am facing now, is that each time, the image is saved as predictions.png, so it is always overwritten

and I am trying to find a way to avoid that

here is how I do it
cat imagenames.txt | ./darknet detect cfg/yolov3.cfg yolov3.weights

commented

@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
Here's a python code to save multiple images from a test.txt file.

import os
import glob
os.system
import PIL
import PIL.Image as Image

d = 0
test_Path = r'E:\ANPR\darknet\build\darknet\x64\data\test'
with open((test_Path + '.txt'),'r') as fobj:
for line in fobj:
image_List = [[num for num in line.split()] for line in fobj]
for images in image_List:
commands = ['darknet.exe detector test data/obj.data yolo-obj_test.cfg backup/yolo-obj_4900.weights -dont_show', images[0]]
os.system(' '.join(commands))
predicted_image = Image.open("E:/ANPR/darknet/build/darknet/x64/predictions.jpg")
output = "E:/ANPR/darknet/build/darknet/x64/data/predictedimages/predicted_image%d.jpg"%d
predicted_image.save(output)
d+=1

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,
I am getting prediction for single images but when I tried for multiple images it is creating result.txt file but empty and showing error like could not open names.list file.

There is a -out option:

./darknet detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg -out myfile

Will write the image to myfile.jpg

There is a -out option:

./darknet detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg -out myfile

Will write the image to myfile.jpg

can you do that for the folder that contains test images =?

@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

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:

  • Detect objects for multiple images in an input folder.
  • Export detected result (images) into the output folder.
  • Export a TXT file with image names, detected classes, confidence and bounding box coordinates.
  • Export a JSON file with image names, detected classes, confidence and bounding box coordinates.

Try now:

https://darknet.gong.im/

Updated: May 14, 2019

Batch images detection using Yolo on AexeyAB Darknet:
https://darknet.gong.im/

I added this function in the source code and resolve this problem with command:

Command

./darknet detector batch cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch exp/in_images/ exp/out_images/ > result/results.txt

Parameter explain:

  1. The input images are: in_images/
  2. The output images are: out_images/
  3. The detection classes with percentage is saved in: exp/results/results.txt

As AlexeyAB updates frequently, hereby I added a stable version of AlexeyAB Darknet with extra convenient functions into my Github repos.
https://github.com/vincentgong7/VG_AlexeyAB_darknet

Usage

  1. Clone this project. See the repo in above link.
  2. Download pre-trained weights file into foder ./weights/. Such as:
    https://pjreddie.com/media/files/yolov3-openimages.weights
  3. Make the project with command in VG_AlexeyAB_darknet/ folder:

make

  1. Use the command described above to perform batch detecting images.

Contact

Any questions please let me know.
vincent.gong7[at]gmail.com
http://www.gong.im

Best Regards,
Vincent

@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

That script also does not worked for me .How did you find a solution to save output of test data ?

Solved! Please see my answer above.

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.

Solved! Please see my answer above.

@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 ?

Solved! Please see my answer above.

@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.

Solved! Please see my answer above.

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

* The input images are: `./in_images/`

* The output images are: `./out_images/`

* The detection classes with percentage is saved in: `./results.txt`

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

1. Install the AlexeyAB/darknet, see: [github link](https://github.com/AlexeyAB/darknet). The darknet is installed in the folder: `darknet/`

2. Replace the `darknet/src/detector.c` with the detector.c in attached.
   [detector.c.zip](https://github.com/pjreddie/darknet/files/2674089/detector.c.zip)

3. Make the project with command in `darknet/` folder:
   `make`

4. If you have already did the make, you may do re-make with commands:
   `clean`
   `make`

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg

Any questions please let me know.
vincent.gong7[at]gmail.com

Best Regards,
Vincent

I managed to make your solution work but I'm still having some issues with the output!
I have a bunch of .jpg images ordered in in_images folder (1.jpg, 2.jpg ... 30.jpg) and it's succesfully saving them all but as 1.jpg.png, 2.jpg.png..

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 find -type f -name '*.png' | while read f; do mv "$f" "${f%.png}"; done
after the program is done but it would be nice if the oput was already the one I'm expecting without running anything afterwards

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

* The input images are: `./in_images/`

* The output images are: `./out_images/`

* The detection classes with percentage is saved in: `./results.txt`

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

1. Install the AlexeyAB/darknet, see: [github link](https://github.com/AlexeyAB/darknet). The darknet is installed in the folder: `darknet/`

2. Replace the `darknet/src/detector.c` with the detector.c in attached.
   [detector.c.zip](https://github.com/pjreddie/darknet/files/2674089/detector.c.zip)

3. Make the project with command in `darknet/` folder:
   `make`

4. If you have already did the make, you may do re-make with commands:
   `clean`
   `make`

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

I managed to make your solution work but I'm still having some issues with the output!
I have a bunch of .jpg images ordered in in_images folder (1.jpg, 2.jpg ... 30.jpg) and it's succesfully saving them all but as 1.jpg.png, 2.jpg.png..

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 find -type f -name '*.png' | while read f; do mv "$f" "${f%.png}"; done
after the program is done but it would be nice if the oput was already the one I'm expecting without running anything afterwards

Thanks Yddeon, I'll modify on it before next week.
BR,
Vincent

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

  • The input images are: ./in_images/
  • The output images are: ./out_images/
  • The detection classes with percentage is saved in: ./results.txt

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

  1. Install the AlexeyAB/darknet, see: github link. The darknet is installed in the folder: darknet/
  2. Replace the darknet/src/detector.c with the detector.c in attached.
    detector.c.zip
  3. Make the project with command in darknet/ folder:
    make
  4. If you have already did the make, you may do re-make with commands:
    clean
    make

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg

Any questions please let me know.
vincent.gong7[at]gmail.com

Best Regards,
Vincent

I think this is worked for me but still not sure
"Not compiled with OpenCV, saving to ./data/output/person_and_bike_092.png.png instead
Not compiled with OpenCV, saving to ./data/output/person_and_bike_014.png.png instead
Not compiled with OpenCV, saving to ./data/output/crop001688.png.png instead
"

when the script is run, the output is like that.
Does it say that opencv is not installed that's why compiled ? could you please light me up for that ?

Hi all, I have resolved the problem about the file name. I’ll update the code in about 4 hours.
Good weekend!

BR,
Vincent

Hi all, I have resolved the problem about the file name. I’ll update the code in about 4 hours.
Good weekend!

BR,
Vincent

I have a question for that.You get result.txt file at the end.Can you calculate mAP (mean average precision) with result.txt file ? if not, how can you calculate ?

Hi all,

The detector.c file is updated fixing the file name problem.
please check it out:
https://github.com/vincentgong7/AlexeyAB_darknet/blob/master/detector.c
I'll also update my previous post for the multiple images process problem here:
#723 (comment)

BR,
Vincent

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

  • The input images are: ./in_images/
  • The output images are: ./out_images/
  • The detection classes with percentage is saved in: ./results.txt

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

  1. Install the AlexeyAB/darknet, see: github link. The darknet is installed in the folder: darknet/
  2. Replace the darknet/src/detector.c with the detector.c in attached.
    detector.c.zip
  3. Make the project with command in darknet/ folder:
    make
  4. If you have already did the make, you may do re-make with commands:
    clean
    make

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

I think this is worked for me but still not sure
"Not compiled with OpenCV, saving to ./data/output/person_and_bike_092.png.png instead
Not compiled with OpenCV, saving to ./data/output/person_and_bike_014.png.png instead
Not compiled with OpenCV, saving to ./data/output/crop001688.png.png instead
"

when the script is run, the output is like that.
Does it say that opencv is not installed that's why compiled ? could you please light me up for that ?

The same printed in my side. I think it means the OpenCV is turned off (either because it is not installed or because it is not turned on).
The result should be not affected.

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

  • The input images are: ./in_images/
  • The output images are: ./out_images/
  • The detection classes with percentage is saved in: ./results.txt

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

  1. Install the AlexeyAB/darknet, see: github link. The darknet is installed in the folder: darknet/
  2. Replace the darknet/src/detector.c with the detector.c in attached.
    detector.c.zip
  3. Make the project with command in darknet/ folder:
    make
  4. If you have already did the make, you may do re-make with commands:
    clean
    make

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

I think this is worked for me but still not sure
"Not compiled with OpenCV, saving to ./data/output/person_and_bike_092.png.png instead
Not compiled with OpenCV, saving to ./data/output/person_and_bike_014.png.png instead
Not compiled with OpenCV, saving to ./data/output/crop001688.png.png instead
"
when the script is run, the output is like that.
Does it say that opencv is not installed that's why compiled ? could you please light me up for that ?

The same printed in my side. I think it means the OpenCV is turned off (either because it is not installed or because it is not turned on).
The result should be not affected.

I have one more question.Can we get coordinates of detected images to calculate the mAP ? I think that the result text file only contains the percentage of guess.How can we get that ? Do you have a suggestion or help ?

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

* The input images are: `./in_images/`

* The output images are: `./out_images/`

* The detection classes with percentage is saved in: `./results.txt`

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

1. Install the AlexeyAB/darknet, see: [github link](https://github.com/AlexeyAB/darknet). The darknet is installed in the folder: `darknet/`

2. Replace the `darknet/src/detector.c` with the detector.c in attached.
   [detector.c.zip](https://github.com/pjreddie/darknet/files/2674089/detector.c.zip)

3. Make the project with command in `darknet/` folder:
   `make`

4. If you have already did the make, you may do re-make with commands:
   `clean`
   `make`

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

I managed to make your solution work but I'm still having some issues with the output!
I have a bunch of .jpg images ordered in in_images folder (1.jpg, 2.jpg ... 30.jpg) and it's succesfully saving them all but as 1.jpg.png, 2.jpg.png..

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 find -type f -name '*.png' | while read f; do mv "$f" "${f%.png}"; done
after the program is done but it would be nice if the oput was already the one I'm expecting without running anything afterwards

Solved, please see my above answer. The code is updated.

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

  • The input images are: ./in_images/
  • The output images are: ./out_images/
  • The detection classes with percentage is saved in: ./results.txt

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

  1. Install the AlexeyAB/darknet, see: github link. The darknet is installed in the folder: darknet/
  2. Replace the darknet/src/detector.c with the detector.c in attached.
    detector.c.zip
  3. Make the project with command in darknet/ folder:
    make
  4. If you have already did the make, you may do re-make with commands:
    clean
    make

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

I think this is worked for me but still not sure
"Not compiled with OpenCV, saving to ./data/output/person_and_bike_092.png.png instead
Not compiled with OpenCV, saving to ./data/output/person_and_bike_014.png.png instead
Not compiled with OpenCV, saving to ./data/output/crop001688.png.png instead
"
when the script is run, the output is like that.
Does it say that opencv is not installed that's why compiled ? could you please light me up for that ?

The same printed in my side. I think it means the OpenCV is turned off (either because it is not installed or because it is not turned on).
The result should be not affected.

I have one more question.Can we get coordinates of detected images to calculate the mAP ? I think that the result text file only contains the percentage of guess.How can we get that ? Do you have a suggestion or help ?

May I know the definition of mAP you referred here. Is it the average percentage of all those guess (%)?
What is the coordinates? is it the bounding box of the object detected on the image? something like: car: 93% (left_x: 1 top_y: 802 width: 134 height: 47)

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

  • The input images are: ./in_images/
  • The output images are: ./out_images/
  • The detection classes with percentage is saved in: ./results.txt

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

  1. Install the AlexeyAB/darknet, see: github link. The darknet is installed in the folder: darknet/
  2. Replace the darknet/src/detector.c with the detector.c in attached.
    detector.c.zip
  3. Make the project with command in darknet/ folder:
    make
  4. If you have already did the make, you may do re-make with commands:
    clean
    make

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

I think this is worked for me but still not sure
"Not compiled with OpenCV, saving to ./data/output/person_and_bike_092.png.png instead
Not compiled with OpenCV, saving to ./data/output/person_and_bike_014.png.png instead
Not compiled with OpenCV, saving to ./data/output/crop001688.png.png instead
"
when the script is run, the output is like that.
Does it say that opencv is not installed that's why compiled ? could you please light me up for that ?

The same printed in my side. I think it means the OpenCV is turned off (either because it is not installed or because it is not turned on).
The result should be not affected.

I have one more question.Can we get coordinates of detected images to calculate the mAP ? I think that the result text file only contains the percentage of guess.How can we get that ? Do you have a suggestion or help ?

May I know the definition of mAP you referred here. Is it the average percentage of all those guess (%)?
What is the coordinates? is it the bounding box of the object detected on the image? something like: car: 93% (left_x: 1 top_y: 802 width: 134 height: 47)

If I'm wrong, please correct me .
To calculate mAP,you need predicted values and ground truth.
In our case,the values are something like that which is coordinates of bounding box;
00082 0.999969 504.637390 651.370789 610.118347 736.534363.

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

  • The input images are: ./in_images/
  • The output images are: ./out_images/
  • The detection classes with percentage is saved in: ./results.txt

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

  1. Install the AlexeyAB/darknet, see: github link. The darknet is installed in the folder: darknet/
  2. Replace the darknet/src/detector.c with the detector.c in attached.
    detector.c.zip
  3. Make the project with command in darknet/ folder:
    make
  4. If you have already did the make, you may do re-make with commands:
    clean
    make

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

I think this is worked for me but still not sure
"Not compiled with OpenCV, saving to ./data/output/person_and_bike_092.png.png instead
Not compiled with OpenCV, saving to ./data/output/person_and_bike_014.png.png instead
Not compiled with OpenCV, saving to ./data/output/crop001688.png.png instead
"
when the script is run, the output is like that.
Does it say that opencv is not installed that's why compiled ? could you please light me up for that ?

The same printed in my side. I think it means the OpenCV is turned off (either because it is not installed or because it is not turned on).
The result should be not affected.

I have one more question.Can we get coordinates of detected images to calculate the mAP ? I think that the result text file only contains the percentage of guess.How can we get that ? Do you have a suggestion or help ?

May I know the definition of mAP you referred here. Is it the average percentage of all those guess (%)?
What is the coordinates? is it the bounding box of the object detected on the image? something like: car: 93% (left_x: 1 top_y: 802 width: 134 height: 47)

If I'm wrong, please correct me .
To calculate mAP,you need predicted values and ground truth.
In our case,the values are something like that which is coordinates of bounding box;
00082 0.999969 504.637390 651.370789 610.118347 736.534363.

Hi, I assume that you would like to train the model or validate the detector. However the function for multiple image procession in this issue (also this post) is only for PREDICT, rather train_detect or validate_predict. So its totally different. Namely, in the PREDICT function, we only detect object in an image using existed model. We do not train model. We do not validate a model.

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

  • The input images are: ./in_images/
  • The output images are: ./out_images/
  • The detection classes with percentage is saved in: ./results.txt

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

  1. Install the AlexeyAB/darknet, see: github link. The darknet is installed in the folder: darknet/
  2. Replace the darknet/src/detector.c with the detector.c in attached.
    detector.c.zip
  3. Make the project with command in darknet/ folder:
    make
  4. If you have already did the make, you may do re-make with commands:
    clean
    make

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

I think this is worked for me but still not sure
"Not compiled with OpenCV, saving to ./data/output/person_and_bike_092.png.png instead
Not compiled with OpenCV, saving to ./data/output/person_and_bike_014.png.png instead
Not compiled with OpenCV, saving to ./data/output/crop001688.png.png instead
"
when the script is run, the output is like that.
Does it say that opencv is not installed that's why compiled ? could you please light me up for that ?

The same printed in my side. I think it means the OpenCV is turned off (either because it is not installed or because it is not turned on).
The result should be not affected.

I have one more question.Can we get coordinates of detected images to calculate the mAP ? I think that the result text file only contains the percentage of guess.How can we get that ? Do you have a suggestion or help ?

May I know the definition of mAP you referred here. Is it the average percentage of all those guess (%)?
What is the coordinates? is it the bounding box of the object detected on the image? something like: car: 93% (left_x: 1 top_y: 802 width: 134 height: 47)

Taha

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

  • The input images are: ./in_images/
  • The output images are: ./out_images/
  • The detection classes with percentage is saved in: ./results.txt

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

  1. Install the AlexeyAB/darknet, see: github link. The darknet is installed in the folder: darknet/
  2. Replace the darknet/src/detector.c with the detector.c in attached.
    detector.c.zip
  3. Make the project with command in darknet/ folder:
    make
  4. If you have already did the make, you may do re-make with commands:
    clean
    make

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

I think this is worked for me but still not sure
"Not compiled with OpenCV, saving to ./data/output/person_and_bike_092.png.png instead
Not compiled with OpenCV, saving to ./data/output/person_and_bike_014.png.png instead
Not compiled with OpenCV, saving to ./data/output/crop001688.png.png instead
"
when the script is run, the output is like that.
Does it say that opencv is not installed that's why compiled ? could you please light me up for that ?

The same printed in my side. I think it means the OpenCV is turned off (either because it is not installed or because it is not turned on).
The result should be not affected.

I have one more question.Can we get coordinates of detected images to calculate the mAP ? I think that the result text file only contains the percentage of guess.How can we get that ? Do you have a suggestion or help ?

May I know the definition of mAP you referred here. Is it the average percentage of all those guess (%)?
What is the coordinates? is it the bounding box of the object detected on the image? something like: car: 93% (left_x: 1 top_y: 802 width: 134 height: 47)

If I'm wrong, please correct me .
To calculate mAP,you need predicted values and ground truth.
In our case,the values are something like that which is coordinates of bounding box;
00082 0.999969 504.637390 651.370789 610.118347 736.534363.

Hi, I assume that you would like to train the model or validate the detector. However the function for multiple image procession in this issue (also this post) is only for PREDICT, rather train_detect or validate_predict. So its totally different. Namely, in the PREDICT function, we only detect object in an image using existed model. We do not train model. We do not validate a model.

Thanks for explanation.I'm trying to find out how my training fits the model and test the model.

Updated: Dec 16, 2018
I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

  • The input images are: ./in_images/
  • The output images are: ./out_images/
  • The detection classes with percentage is saved in: ./results.txt

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

  1. Install the AlexeyAB/darknet, see: github link. The darknet is installed in the folder: darknet/
  2. Replace the darknet/src/detector.c with the detector.c:
    https://github.com/vincentgong7/AlexeyAB_darknet/blob/master/detector.c
  3. Make the project with command in darknet/ folder:
    make
  4. If you have already did the make, you may do re-make with commands:
    clean
    make

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg

Any questions please let me know.
vincent.gong7[at]gmail.com

Best Regards,
Vincent

Thank you for your improvement!
When I executed the make command exactly as you say, I got an error like the following.
./src/detector.c:46:6: error: conflicting types for 'train_detector'
  void train_detector (char * datacfg, char * cfgfile, char * weightfile, int * gpus,
compilation terminated due to - Wfatal - errors.
Makefile: 136: Failed with recipe for target 'obj / detector.o'
make: *** [obj / detector.o] Error 1

commented

can i inference images by batch? is it faster than one by one?

dont_show supposed to not show the output of training ,right? I still see the output.Is this related with cuda version ? @AlexeyAB

commented

i am training yolov3-tiny and every time my training goes wrong either during training or after training it won't detect the object correctly.
My class of interest is "person" and i tried different datasets like "Caltech", "INRIA" and my on generated dataset but i don't know what is wrong.
i just wanted to know during training should i put test images as well in the same images folder because there is test.txt file associated to that and i don't know how to handle test.txt file

commented

i am training yolov3-tiny and every time my training goes wrong either during training or after training it won't detect the object correctly.
My class of interest is "person" and i tried different datasets like "Caltech", "INRIA" and my on generated dataset but i don't know what is wrong.
i just wanted to know during training should i put test images as well in the same images folder because there is test.txt file associated to that and i don't know how to handle test.txt file
@AlexeyAB

Hi geeks,

I just revised the code for batch image process for the newest version of darknet_ab. Currently I'm testing my code. I'll upload & update it today in about 3 hours.
Just in case you want to know.
Sorry for the delay these days, crazy busy.

BR,
Vincent

Updated: Dec 16, 2018
I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

  • The input images are: ./in_images/
  • The output images are: ./out_images/
  • The detection classes with percentage is saved in: ./results.txt

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

  1. Install the AlexeyAB/darknet, see: github link. The darknet is installed in the folder: darknet/
  2. Replace the darknet/src/detector.c with the detector.c:
    https://github.com/vincentgong7/AlexeyAB_darknet/blob/master/detector.c
  3. Make the project with command in darknet/ folder:
    make
  4. If you have already did the make, you may do re-make with commands:
    clean
    make

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

Thank you for your improvement!
When I executed the make command exactly as you say, I got an error like the following.
./src/detector.c:46:6: error: conflicting types for 'train_detector'
  void train_detector (char * datacfg, char * cfgfile, char * weightfile, int * gpus,
compilation terminated due to - Wfatal - errors.
Makefile: 136: Failed with recipe for target 'obj / detector.o'
make: *** [obj / detector.o] Error 1

Fixed. please see: #723 (comment)

This problem is updated and fixed. Please refer to #723 (comment)

commented
commented

When I change some convolutional layers in cfg file according to my dataset it will give me an error.
#error Last layer must detection layer.
How to solve this problem @AlexeyAB

When I change some convolutional layers in cfg file according to my dataset it will give me an error.
#error Last layer must detection layer.
How to solve this problem @AlexeyAB

How did you change ?

I want to extract bounding box object and save it as separate image file. Can anyone please help me out?

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?

how to run detections on single image... after training yolo v3 ...
i have weights after training now i wanna check it on new image.

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?

how to run detections on single image... after training yolo v3 ...
i have weights after training now i wanna check it on new image.

Please see the instruction: https://github.com/AlexeyAB/darknet

@AlexeyAB I just realized that. Stupid mistake on my part. So I got it working, but the results.txt file only says the following:
"Enter Image Path: /home/aruw/cv_data/train_images/red_real_world_404.jpg: Predicted in 1278.649000 milli-seconds.
Enter Image Path: /home/aruw/cv_data/train_images/red_real_world_2131.jpg: Predicted in 1155.518000 milli-seconds.
Enter Image Path: /home/aruw/cv_data/train_images/blue_ground_5_148.jpg: Predicted in 1256.826000 milli-seconds.
blue: 95%"

Nothing is written about the bounding boxes info. Any ideas?

@spencerkraisler

Use -ext_output flag

./darknet detector test data/voc.data yolo-voc.cfg yolo-voc.weights -dont_show -ext_output < data/train.txt > result.txt

Also read: https://github.com/AlexeyAB/darknet#how-to-use-on-the-command-line

Batch images detection using Yolo on AexeyAB Darknet:
https://darknet.gong.im/

I made a page for this.

Updated: May 14, 2019

Batch images detection using Yolo on AexeyAB Darknet:
https://darknet.gong.im/

I added this function in the source code and resolve this problem with command:

Command

./darknet detector batch cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch exp/in_images/ exp/out_images/ > result/results.txt

Parameter explain:

  1. The input images are: in_images/
  2. The output images are: out_images/
  3. The detection classes with percentage is saved in: exp/results/results.txt

As AlexeyAB updates frequently, hereby I added a stable version of AlexeyAB Darknet with extra convenient functions into my Github repos.
https://github.com/vincentgong7/VG_AlexeyAB_darknet

Usage

  1. Clone this project. See the repo in above link.
  2. Download pre-trained weights file into foder ./weights/. Such as:
    https://pjreddie.com/media/files/yolov3-openimages.weights
  3. Make the project with command in VG_AlexeyAB_darknet/ folder:

make

  1. Use the command described above to perform batch detecting images.

Contact

Any questions please let me know.
vincent.gong7[at]gmail.com
vincentgong.net

Best Regards,
Vincent

Amazing, vincentgong7! Thank You very much!

Hi, How can I run yolov3 on open image v4 test data set and calculate overall mAP instead on running on a single image and getting prediction?

Hi, How can I run yolov3 on open image v4 test data set and calculate overall mAP instead on running on a single image and getting prediction?

Hi, I have similar requirements. My solution is to run it on the batch mode (link) and export the report file (the text file lists which objects and their amount in each image). Then I made a tool to read this report and calculate the mAP or any other metrics I need.

Hi, How can I run yolov3 on open image v4 test data set and calculate overall mAP instead on running on a single image and getting prediction?

Hi, You can keep the test images and the label files in a directory, then create a text file having directory/path of each image similar to train.txt. Update your custom.data file "valid = this text file directory/path"
After this run command
./darknet detector map cfg/custom.data cfg/custom_yolov3.cfg backup/custom_yolov3_xxx.weights
hope this helps.
If you want to save the map results in a text file then pass command ">directory of textfile"

@AlexeyAB , I am using a custom object detector, trained with your fork of darknet.
However, when I try to predict on a directory of images with the -dont_show argument, I am facing 2 problems:

  • The result.txt file only shows output like this:
    Enter Image Path: test1.jpg: Predicted in 8.559000 milli-seconds.
    object1: 99%
    But, actual coordinates are not printed.

  • I believe the inferencing is happening one image at a time. In my case, I would like it to treat the images batch by batch (in batches of 32 or 64 images) instead of individually, and do the prediction. This, I believe, would be more efficient. Is there a way to do that? All images are 416X416.

My current usage is to load the darknet CFG and WEIGHT file into the cv2.dnn module (in Python) and do the inferencing on batches. It works fine. However, cv2.dnn doesn't (yet) have a GPU backend, so it relies on CPU only. I was wondering if the same could be done with the darknet executable.

@trdastidar, Just curious, How much fps are you getting when running it on cpu with cv2.dnn module for batches of 64 images?

@Dikshantbisht13 - it takes 1.1-1.2 seconds for 48 images (416X416 each). CPU is 4 core i3-8100 3.6GHz. I have noticed it takes up at least 3 cores, depending on availability. So, single core performance would be 16-20 FPS.

@trdastidar Wow that's great, what were the changes you made? can you share your repository if possible. I'm getting around 15 fps on GTX-1080, 8GB.

@Dikshantbisht13 , sorry can't share the repo. However, here's the invocation code if you are interested.

    def __run_yolo_model_darknet(self):
        images = [p[1] for p in self.__patches]
        self.logger.info("Invoking model on %d patches from %s",
                    len(images), self.curr_img_name)
        blob = cv2.dnn.blobFromImages(images, 1/255.0,
                    (self.patch_size, self.patch_size),
                    swapRB=True, crop=False)

        self.__net.setInput(blob)
        self.__layer_outputs = self.__net.forward(self.__ln)
        self.logger.info("Finished invoking model")
        return
commented

@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 ?

Solved! Please see my answer above.

Please

can i use this on web_cam from cam_demo.py and get the bounding boxes position
so i can run the output alone to show the bounding boxes alone without the object, like running webcam in dark background with the bounding boxes form the same positions.
as someone suggested can i use that to extract real time webcam form this code:
./darknet detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg -out myfile

@austinmw Yes.
For Yolo v3:
./darknet detector test ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights -dont_show < data/train.txt > result.txt

Hi, what if I want to save the bounding box data from a webcam link? How can I update that file real-time?

Thanks

Hi, folks out there how can I display the ground truth bounding boxes together in the predictions.png result of YOLOv3?

@austinmw Yes.
For Yolo v3:
./darknet detector test ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights -dont_show < data/train.txt > result.txt

@AlexeyAB
when i run this command i get this :

 Used AVX 
 Used FMA & AVX2 
batch = 1, time_steps = 1, train = 0 
 
 seen 64, trained: 32013 K-images (500 Kilo-batches_64) 
Enter Image Path: E:\Graduation_Project\sora_wahda\2007_000027.jpg: Predicted in 10741.350000 milli-seconds.
person: 100%
skateboard: 93%
Enter Image Path: E:\Graduation_Project\sora_wahda\000000000802.jpg: Predicted in 11832.705000 milli-seconds.
oven: 95%
refrigerator: 100%
Enter Image Path: E:\Graduation_Project\sora_wahda\000000000872.jpg: Predicted in 12173.174000 milli-seconds.
person: 100%
person: 97%
baseball glove: 59%
Enter Image Path: E:\Graduation_Project\sora_wahda\000000001296.jpg: Predicted in 12025.858000 milli-seconds.
person: 100%
person: 96%
cell phone: 96%
person: 28%
Enter Image Path: 

no BBox Info at all how can i fix it ?

@alsawaf

./darknet detector test ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights -dont_show -ext_output < data/train.txt > result.txt

More: https://github.com/AlexeyAB/darknet#how-to-use-on-the-command-line

@alsawaf

./darknet detector test ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights -dont_show -ext_output < data/train.txt > result.txt

More: https://github.com/AlexeyAB/darknet#how-to-use-on-the-command-line

@AlexeyAB Thanks it worked now , but i have another question
whenever i try to run the command for videos i get an error

E:\Graduation_Project\darknet-master\build\darknet\x64>darknet_no_gpu.exe detector demo data/coco.data cfg/yolov3.cfg yolov3.weights C:\Users\AmrMohsenmohamed\Downloads\1480956055370168.mp4 -out_filename res.avi

Used AVX
Used FMA & AVX2
OpenCV isn't used
Demo needs OpenCV for webcam images.

OpenCV is installed and is set = 1 in makefile

is there a way to extract the detected object from a video and save as images based on if accuracy => 70% via a python call

commented

@AlexeyAB
I am following the solution that you suggested and my repository is https://github.com/AlexeyAB/darknet
./darknet detector test ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights -dont_show -ext_output < data/train.txt > result.txt

, but I face the following issue - the content of my result.txt file is just saying "Enter Image Path..." and no class and bbox coordinates are given:

net.optimized_memory = 0
mini_batch = 1, batch = 1, time_steps = 1, train = 0
seen 64, trained: 256 K-images (4 Kilo-batches_64)
Enter Image Path: data/obj/LNDb-0055_finding4_rad1.jpg
: Predicted in 19.972000 milli-seconds.
Enter Image Path: data/obj/LNDb-0018_finding1_rad2.jpg
: Predicted in 19.732000 milli-seconds.
Enter Image Path: data/obj/LNDb-0043_finding2_rad1.jpg
: Predicted in 19.859000 milli-seconds.

And the result.txt file is generated (with the above content) even tho I have this output for each image: "Cannot load image data/obj/LNDb-0219_finding1_rad1.jpg" when running ./darknet detector test........

Please advise me what to do.

Hi all,

I am trying to use a detection to trigger an event.

For example if dog is detected in image print woof or something like that.

I have tried screwing around in image.c and so far only managed to make every prediction return as woof woof woof even if not a dog etc. Is there an easier way to make a detection trigger an event? Any advice would be greatly appreciated, struggled on this for a while now.

Updated: May 07, 2020

Hi all, I just updated my repository.

I added the function of exporting the bounding box coordinates and classes names, confidence for each image in an input folder.

Now it supports:

  • Detect objects for multiple images in an input folder.
  • Export detected result (images) into the output folder.
  • Export a TXT file with image names, detected classes, confidence and bounding box coordinates.
  • Export a JSON file with image names, detected classes, confidence and bounding box coordinates.

Example:

Check the sample_imgs folder and the output folder in my repository master branch.

Try now:

https://darknet.gong.im/

@AlexeyAB
I am following the solution that you suggested and my repository is https://github.com/AlexeyAB/darknet
./darknet detector test ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights -dont_show -ext_output < data/train.txt > result.txt

, but I face the following issue - the content of my result.txt file is just saying "Enter Image Path..." and no class and bbox coordinates are given:

net.optimized_memory = 0
mini_batch = 1, batch = 1, time_steps = 1, train = 0
seen 64, trained: 256 K-images (4 Kilo-batches_64)
Enter Image Path: data/obj/LNDb-0055_finding4_rad1.jpg
: Predicted in 19.972000 milli-seconds.
Enter Image Path: data/obj/LNDb-0018_finding1_rad2.jpg
: Predicted in 19.732000 milli-seconds.
Enter Image Path: data/obj/LNDb-0043_finding2_rad1.jpg
: Predicted in 19.859000 milli-seconds.

And the result.txt file is generated (with the above content) even tho I have this output for each image: "Cannot load image data/obj/LNDb-0219_finding1_rad1.jpg" when running ./darknet detector test........

Please advise me what to do.

Hi hbiserinska, if you want to detect objects on a set of images in a folder and get the bounding box and class names, you can try my solution:
https://darknet.gong.im

Let me know if you have any questions.

It is easy to save output file just type this command
darknet.exe detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights airport.mp4 -out_filename results.mp4

where results.mp4 is output video and airport,mp4 is input video

I added this function in the source code and resolve this problem with command:

./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights batch ./in_images/ ./out_images/ >./results.txt

Parameter explain:

* The input images are: `./in_images/`

* The output images are: `./out_images/`

* The detection classes with percentage is saved in: `./results.txt`

To reach this, you need to replace the attached detector.c into ./src/ folder and re-make the AlexeyAB darknet.

Detail process:

1. Install the AlexeyAB/darknet, see: [github link](https://github.com/AlexeyAB/darknet). The darknet is installed in the folder: `darknet/`

2. Replace the `darknet/src/detector.c` with the detector.c in attached.
   [detector.c.zip](https://github.com/pjreddie/darknet/files/2674089/detector.c.zip)

3. Make the project with command in `darknet/` folder:
   `make`

4. If you have already did the make, you may do re-make with commands:
   `clean`
   `make`

You may still do for one image with:
./darknet detector test cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights ./data/dog.jpg
Any questions please let me know.
vincent.gong7[at]gmail.com
Best Regards,
Vincent

I managed to make your solution work but I'm still having some issues with the output!
I have a bunch of .jpg images ordered in in_images folder (1.jpg, 2.jpg ... 30.jpg) and it's succesfully saving them all but as 1.jpg.png, 2.jpg.png..

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 find -type f -name '*.png' | while read f; do mv "$f" "${f%.png}"; done
after the program is done but it would be nice if the oput was already the one I'm expecting without running anything afterwards

Hi, it should have been done already.

I am unable to implement this (saving all objects detected from a folder of images in txt file) its showing cannot load image even if the paths are correct
Screenshot (146)

I am unable to implement this (saving all objects detected from a folder of images in txt file) its showing cannot load image even if the paths are correct
Screenshot (146)

It's strange. Could you also try on even one image on the collab? because I doubt that this is because of the problem of accessing files on google drive which monted to the collab.

If you have a Linux or Windows, you may also try there.
In another hand, I will find a time to try the collab and make it work.

Using this fork: https://github.com/AlexeyAB/darknet
you can use this command:
./darknet detector test data/voc.data yolo-voc.cfg yolo-voc.weights -dont_show < data/train.txt > result.txt

in the file data/train.txt you should have paths to images
in the file result.txt will be results of detections

how to change the threshold here(I think there is some default threshold and I wanna change it)

I am unable to implement this (saving all objects detected from a folder of images in txt file) its showing cannot load image even if the paths are correct
Screenshot (146)

It's strange. Could you also try on even one image on the collab? because I doubt that this is because of the problem of accessing files on google drive which monted to the collab.

If you have a Linux or Windows, you may also try there.
In another hand, I will find a time to try the collab and make it work.

thanks for the help

Using this fork: https://github.com/AlexeyAB/darknet
you can use this command:
./darknet detector test data/voc.data yolo-voc.cfg yolo-voc.weights -dont_show < data/train.txt > result.txt
in the file data/train.txt you should have paths to images
in the file result.txt will be results of detections

how to change the threshold here(I think there is some default threshold and I wanna change it)

@AlexeyAB

I am unable to implement this (saving all objects detected from a folder of images in txt file) its showing cannot load image even if the paths are correct
Screenshot (146)

It's strange. Could you also try on even one image on the collab? because I doubt that this is because of the problem of accessing files on google drive which monted to the collab.

If you have a Linux or Windows, you may also try there.
In another hand, I will find a time to try the collab and make it work.

@vincentgong7 can u pls help ... what if I want the fix my own threshold and get the output txt file accordingly if I run the command
!./darknet detector test data/obj.data cfg/yolov3_custom.cfg /mydrive/yolov3/backup/yolov3_custom_4000.weights -dont_show </mydrive/yolov3/img.txt> result.txt
if I run this command only if the thresh is greater than 0.25 it is stored into this file but I want to set threshold as 0.1

For the people using Colab, please see the example:

https://bit.ly/vg_yolo_v4_colab

More detail information, please check:

https://darknet.gong.im

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.

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.

@vincentgong7 Sir, Can you help me to get only detected object(Licence plate) only from video?

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

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.

What is the data/coco.data for darknet detector test ? It looks while testing, data/coco.data is pointless?