mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 08:56:35 +00:00
reorganizing files
add train some catches
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from pathlib import Path
|
||||
import cv2
|
||||
import os.path
|
||||
|
||||
from dto.annotationClass import AnnotationClass
|
||||
from dto.imageLabel import ImageLabel
|
||||
from preprocessing import read_labels
|
||||
|
||||
images_dir = '../images'
|
||||
labels_dir = '../labels'
|
||||
annotation_classes = AnnotationClass.read_json()
|
||||
|
||||
|
||||
image = os.listdir(images_dir)[0]
|
||||
image_path = os.path.join(images_dir, image)
|
||||
labels_path = os.path.join(labels_dir, f'{Path(image_path).stem}.txt')
|
||||
|
||||
img = ImageLabel(
|
||||
image_path=image_path,
|
||||
image=cv2.imread(image_path),
|
||||
labels_path=labels_path,
|
||||
labels=read_labels(labels_path)
|
||||
)
|
||||
|
||||
img.visualize(annotation_classes)
|
||||
Reference in New Issue
Block a user