-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add visualizer, datareader, pseudo-main #3
base: main
Are you sure you want to change the base?
Conversation
dest='video_path', | ||
default='samplevideo.mp4') | ||
parser.add_argument('-i', '--image', | ||
help='Path to an images', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to images
self.index += 1 | ||
img = cv.imread(img_path) | ||
if img is None: | ||
raise ValueError(f"Не получилось считать изображение: {img_path}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English
parser = argparse.ArgumentParser() | ||
|
||
parser.add_argument('-t', '--mode', | ||
help='Mode (\'image\', \'video\', \'img-pack\')', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
img-pack
help='Path to an images', | ||
type=str, | ||
dest='images_path', | ||
default="D:/SEMYON/UNN/ITLAB/DLMini/data/imgs_MOV03478") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убрать подобные полные пути.
help='Path to a dir of layout', | ||
type=str, | ||
dest='dir_layout_path', | ||
default="D:/SEMYON/UNN/ITLAB/DLMini/layout/mov03478.txt") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Аналогично.
#некоторое подобие main | ||
def main(): | ||
args = cli_argument_parser() | ||
reader = DataReader.create(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отдать в качестве параметра args.mode
pass | ||
|
||
@staticmethod | ||
def create(args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode
def create(args): | ||
# Проверяем, чтобы метод вызывался только на уровне базового класса | ||
if DataReader != globals().get('DataReader'): | ||
raise TypeError("Метод 'create' может быть вызван только в классе DataReader.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Удалить
type=str, | ||
dest='images_path', | ||
default="D:/SEMYON/UNN/ITLAB/DLMini/data/imgs_MOV03478") | ||
parser.add_argument('-l', '--layout', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
groudtruth
# Рисуем прямоугольник | ||
cv.rectangle(image, (x1, y1), (x2, y2), (0, 255, 0), 2) # Зеленый прямоугольник, толщина 2 | ||
# Подписываем класс | ||
cv.putText(image, label, (x1, y1 - 10), cv.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
При наличии разметки необходимо отображать и размеченные прямоугольники.
Files in gui_application folder.