HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
18.38k stars 2.31k forks source link

Value in YOLO output is out of bounds #5014

Open XM-8JD2 opened 10 months ago

XM-8JD2 commented 10 months ago

Describe the bug Value in YOLO output is out of bounds

To Reproduce 1.Export comments

  1. Insert the official training script of YOLOv5
  2. python train.py --img 640 --epochs 600 --data dataset-1.yaml --weights yolov5s.pt
  3. See the prompt:
    
    Transferred 343/349 items from yolov5s.pt
    AMP: checks passed
    optimizer: SGD(lr=0.01) with parameter groups 57 weight(decay=0.0), 60 weight(decay=0.0005), 60 bias
    train: Scanning C:\Users\x\datasets\project-9-at-2023-10-30-13-53-eadc03df\labels.cache... 282 images, 0 background
    train: WARNING  C:\Users\x\datasets\x1.png: ignoring corrupt image/label: non-normalized or out of bounds coordinates [     1.0004]
    val: Scanning C:\Users\x\datasets\project-9-at-2023-10-30-13-53-eadc03df\labels.cache... 282 images, 0 backgrounds,
    train: WARNING  C:\Users\x\datasets\project-9-at-2023-10-30-13-53-eadc03df\images\x1.png: ignoring corrupt image/label: non-normalized or out of bounds coordinates [     1.0004]

AutoAnchor: 4.11 anchors/target, 0.950 Best Possible Recall (BPR). Anchors are a poor fit to dataset , attempting to improve...

x1:
(1920*1080)

4 0.3040172304425921 0.5002812148481438 0.6080344608851842 1.0004374453193348 8 0.275215598050244 0.24733366662500514 0.29996250468691316 0.4946673332500103 3 0.786839145106863 0.8529871266091742 0.4263217097862742 0.29402574678165144 1 0.8164604424446948 0.8536537099529238 0.3670791151106102 0.29269258009415233 1 0.6077990251218597 0.5002499687539058 0.7844019497562802 1.0003749531308588



**Expected behavior**
YOLO does not throw this error

**Screenshots**
null

**Environment (please complete the following information):**
OS:[win10 21H2 LTSC]
Label Studio Version [v1.9.1.post0]

**Additional context**
null
YannikBleilinger commented 10 months ago

I have the same issue for about 70 of 200 images. Is there any fix yet ?

hogepodge commented 10 months ago

Hi @XM-8JD2 I want to confirm the issue. Are these Labels for YOLO that are being exported by Label Studio after you've completed annotating them?

I'm assuming that YOLO is expecting bounding box values of 0.0 <= (x,y) <= 1.0

XM-8JD2 commented 10 months ago

你好@XM-8JD2我想确认一下这个问题。这些 YOLO 标签是在您完成注释后由 Label Studio 导出的吗?

我假设 YOLO 期望的边界框值为0.0 <= (x,y) <= 1.0

Yes, these YOLO tags were exported by Label Studio after I completed the annotation

KonstantinKorotaev commented 9 months ago

@XM-8JD2 did you use rotation in your annotations?

XM-8JD2 commented 9 months ago

@XM-8JD2您在注释中使用了旋转吗?

No, I'm not using rotation

KonstantinKorotaev commented 9 months ago

@XM-8JD2 Can you share an example of your annotation and image resolution?

KonstantinKorotaev commented 8 months ago

@YannikBleilinger could you please share example of your annotation and image resolution?

biggeR-data commented 2 weeks ago

Hi, I just ran into the same problem. I have investigated it thoroughly and found out, that there is no conversion error at work here. Instead it's a result of a lack of annotation value range validation & visual display of boxes.

It occured only for other annotators, not myself, so I can only guess how this happened. I believe all of my users that caused this issue did use Windows OS on a laptop. It seems they bugged out and placed a box outside of the image bounds. So there were essentially boxes with a width / height over 100 or one of the X/Y coordinates was above 100 / below 0.

This was able to be submitted as an annotation (which it shouldn't in my opinion, so I suggest this needs some sort of validation) and the out-of-bounds box was not even displayed in the UI.

You can find it by navigating the classes tab and checking if a highlighted box in this tab is also highlighted in the UI. Delete the box not highlighted (you also see the faulty properties in the info tab) and all is solved.