Closed stark-t closed 1 year ago
I also do not see anything strange for now.
Here was my bash script that I managed to test for detect.py for yolov4: https://github.com/stark-t/PAI/blob/dev_cluster/scripts/cluster/yolov4_detect_pacsp_s_640_rtx.sh
For yolov7, I have the one below running right now, and based on this one and the one above I will try a loop for the yolov4 detct.py later and give you more feedback.
# This will create a folder in ~/PAI/detectors/yolov7/runs/detect with the name given in the --project argument.
# In that folder there will be several otehr folders containing the label files.
# The names of these folders are created via the --name argument.
for conf in $(seq 0.1 0.1 0.9)
do
for iou in $(seq 0.1 0.1 0.9)
do
python detect.py \
--weights ~/PAI/detectors/yolov7/runs/train/3219805_yolov7_img640_b8_e300_hyp_custom/weights/best.pt \
--source /home/sc.uni-leipzig.de/sv127qyji/datasets/P1_Data_sampled/test/images \
--img-size 640 \
--conf-thres "$conf" \
--iou-thres "$iou" \
--save-txt \
--save-conf \
--nosave \
--project runs/detect/job_"$SLURM_JOB_ID"_loop_detect_on_3219805_yolov7_img640_b8_e300_hyp_custom \
--name results_at_conf_"$conf"_iou_"$iou"
done
done
I didn't see in yours the argument --img-size
. Perhaps that is optional, but check what the default is from case to case so that it matches what we used for training. I think 640 is the default and this might work, so not sure if that is the issue.
I however used a different --cfg
file. I used cfg/yolov4-csp-s-leaky.cfg
. If you get the weights and their corresponding cfg files from https://github.com/WongKinYiu/PyTorch_YOLOv4, you will see that yolov4-csp-s-leaky.cfg
corresponds to yolov4-csp-s-leaky.weights
pre-trained weights which I used for training.
Also, for yolov4 I will switch from using best_overall.pt
to best.pt
as we agreed here https://github.com/stark-t/PAI/issues/50#issuecomment-1231526134
@valentinitnelav yes i check that 640px is the default image size for all three versions
By the way, in my case, for YOLOv4 the images and label files are saved in the same folder in ~/PAI/detectors/PyTorch_YOLOv4/runs/detect/
.
I will push the cluster scripts for loop detection for YOLOv4 & 7 on GitHub in few moments.
I think the loop job will take at 4-5 hours to run for the 9*9 possible values (0.1 to 0.9 with a step of 0.1) for conf and IoU. The folder structure of the output will be similar for yolov7 & 5, but yolov4 breaks a bit that pattern with having the image files saved (there is no argument to stop that) and image and label files in the same output folder.
I will write a loop script for YOLOv5 as well, just realized I didn't do that :D. So far I have for YOLOv7 & 4.
@valentinitnelav So I'm currently running the 9*9 grids but the results are really bad. Could it be that we don't have the same test dataset? Could you send me your test dataset, because there 90% missing detections.
@stark-t
Hi Tommi, now I realize that most probably we have different train, test, val datasets because of how the seed is set/works differently on your Windows PC and on the Linux cluster that I use (even on the cluster might depend on the environments set at run time).
I am downloading right now the test dataset from the cluster and uploading it on a Dropbox link. Will send it to you via an email as soon as the link is operational.
@valentinitnelav evaluate script
Due to #51 and #52 here is the shell code I used for the YOLOv4 prediction. The code only return the images but not a single prediction. I'm not sure if there is an error in my code.
YOLOv5 threshold grid search
YOLOv4