Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Increase column width allowance for YOLO label outputs to accomodate …
Browse files Browse the repository at this point in the history
…prediction confidence scores
  • Loading branch information
smohan123 committed May 1, 2024
1 parent 240742a commit 4dad78a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion label_studio_converter/imports/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def convert_yolo_to_ls(
# convert all bounding boxes to Label Studio Results
lines = file.readlines()
for line in lines:
label_id, x, y, width, height = line.split()
values = line.split()
label_id, x, y, width, height = values[0:5]
score = float(values[5]) if len(values) >= 6 else None
x, y, width, height = (
float(x),
float(y),
Expand All @@ -135,6 +137,8 @@ def convert_yolo_to_ls(
"original_width": image_width,
"original_height": image_height,
}
if score:
item["score"] = score
task[out_type][0]['result'].append(item)

tasks.append(task)
Expand Down

0 comments on commit 4dad78a

Please sign in to comment.