Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
4 changes: 4 additions & 0 deletions tests/assets/yolo_input_file/raise-the-flag_frame00001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
8 0.61953125 0.43333333333333335 0.3265625 0.08333333333333333
8 0.640625 0.43125 0.328125 0.08333333333333333
8 0.50703125 0.42916666666666664 0.3265625 0.08333333333333333
8 0.51875 0.4322916666666667 0.325 0.08541666666666667
1 change: 1 addition & 0 deletions tests/assets/yolo_input_file/raise-the-flag_frame00002.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8 0.5921875 0.4375 0.325 0.08333333333333333
2 changes: 2 additions & 0 deletions tests/assets/yolo_input_file/raise-the-flag_frame00003.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
8 0.58125 0.4354166666666667 0.325 0.08333333333333333
8 0.528125 0.428125 0.325 0.08541666666666667
1 change: 1 addition & 0 deletions tests/assets/yolo_input_file/raise-the-flag_frame00004.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8 0.565625 0.4270833333333333 0.325 0.0875
2 changes: 2 additions & 0 deletions tests/assets/yolo_input_file/raise-the-flag_frame00005.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
8 0.540625 0.42291666666666666 0.325 0.0875
8 0.5546875 0.42291666666666666 0.325 0.0875
28 changes: 28 additions & 0 deletions tests/test_convert_yolo_xyxy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import filecmp
import shutil

from utils import get_relative_path

from universal_devkit.scripts.convert_yolo_to_xyxy import (
convert_images_from_yolo_to_xyxy,
)


def test_create_logs_json():
# The path to the folder with yolo input files
input_files_path = get_relative_path("assets/yolo_input_file")

# The directory to be used as output
output_files_path = get_relative_path("assets/yolo_output_files")

# Correct yolo files
correct_output_path = get_relative_path("assets/yolo_correct_files")

# Convert the yolo input files to xyxy
convert_images_from_yolo_to_xyxy(input_files_path, output_files_path)

comp = filecmp.dircmp(output_files_path, correct_output_path)

assert len(comp.same_files) == 6

shutil.rmtree(output_files_path)