riips / AIC24_Track1_YACHIYO_RIIPS

MIT License
10 stars 1 forks source link

ValueError: Coordinate 'lower' is less than 'upper' #2

Closed XIEBELL closed 2 months ago

XIEBELL commented 2 months ago

HELLO: When I reproduced your experiment, I encountered this error:

processing file camera_0542.txt processing scene scene_061 cam camera_0542 with 57622 detections process 0/57622 processing time : 36.256227254867554 process 1000/57622 processing time : 35.841145753860474 process 2000/57622 processing time : 35.340980052948 process 3000/57622 processing time : 35.1763551235199 process 4000/57622 processing time : 33.96897530555725 process 5000/57622 processing time : 34.186134815216064 process 6000/57622 processing time : 34.828025341033936 process 7000/57622 processing time : 34.20278453826904 process 8000/57622 Traceback (most recent call last): File "torchreid/aic24_extract.py", line 98, in img_crop = img.crop((x1,y1,x2,y2)) File "/root/miniconda3/lib/python3.8/site-packages/PIL/Image.py", line 1240, in crop raise ValueError(msg) ValueError: Coordinate 'lower' is less than 'upper'

Then I output their coordinates: process 8000/57622 : Coordinate 'lower' is less than 'upper' : x1=0.0, y1=0.0, x2=60.0, y2=-4.0

Is that why?

XIEBELL commented 2 months ago

Is it because I enabled fp16?

XIEBELL commented 2 months ago

processing file camera_0624.txt processing scene scene_069 cam camera_0624 with 298219 detections process 0/298219 processing time : 41.1336932182312

。。。。。 。。。。。 。。。。。

processing time : 33.38526725769043 process 282000/298219 Traceback (most recent call last): File "torchreid/aic24_extract.py", line 94, in img_crop = img.crop((x1,y1,x2,y2)) File "/root/miniconda/envs/torchreid/lib/python3.8/site-packages/PIL/Image.py", line 1299, in crop raise ValueError(msg) ValueError: Coordinate 'lower' is less than 'upper'

riips commented 2 months ago

Hi XIEBELL,

I apologize for the delayed response and thank you for your patience.

I'm not sure why the model outputs y2 lower than y1. However, the cause of this error is clear: it is because the y2 coordinate is outside the image frame.

I can resolve this error, but I'm quite busy, so it might take some time for me to get to it.

If you need to run this code immediately, please add exception handling for the detected coordinates before the image cropping process in line 93 of embedder/aic24_extract.py.

Best regards, RIIPS

XIEBELL commented 2 months ago

@riips

I have solved this problem in a simple way: by adding code.

if y2 > y1:
    print(y2 > y1)
    y2 = y1

Although this may affect the outcome, there is only one such instance, so it's not a major issue.

riips commented 2 months ago

Thank you for letting me know that you have resolved the issue. I'm glad to hear it!

If you encounter any other problems or have further questions, please feel free to reach out.

Best regards, RIIPS