-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileManagersTestMain.py
More file actions
20 lines (15 loc) · 953 Bytes
/
FileManagersTestMain.py
File metadata and controls
20 lines (15 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from FileManagers.ImageManagerImpl import ImageManagerImpl
from FileManagers.LabelManagerImpl import LabelManagerImpl
dataset_dir: str = "../dataset/"
test_subject_dir: str = "Subject 1/"
images_exts: (str) = (".jpg", ".png")
yolo_labels_dir: str = "../dataset/Labels/YOLO/"
image_manager: ImageManagerImpl = ImageManagerImpl(images_exts)
label_manager: LabelManagerImpl = LabelManagerImpl(yolo_labels_dir, image_manager)
images_paths = image_manager.get_all_images_in_path_and_subdirs(dataset_dir + test_subject_dir)
test_image_path: str = images_paths[0]
yolo_file: str = label_manager.get_YOLO_file_from_image_path(test_image_path)
label_manager.read_YOLO_file(path = yolo_file,
on_file_opened = lambda path: print("opened yolo file -> " + path + "\n"),
on_line_read = lambda line: print("read line -> " + line),
on_eof = lambda: print("---> EOF <---"))