From 25469d39577aaa4e06a4b48ff7cdb5c2b4821b3c Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sun, 5 Feb 2017 16:33:00 +0300 Subject: Initial version 0.1.0 --- YOSO/__init__.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 YOSO/__init__.py (limited to 'YOSO/__init__.py') diff --git a/YOSO/__init__.py b/YOSO/__init__.py new file mode 100644 index 0000000..1decc61 --- /dev/null +++ b/YOSO/__init__.py @@ -0,0 +1,35 @@ +from PyQt5.QtWidgets import QApplication +from YOSO.MainWindow import MainWindow +import os +import re +import sys + + +IMAGE_FILE_TEMPLATES = ['*.png', '*.jpg', '*.jpeg'] + +def imagesDir(datadir): + return os.path.join(datadir, 'images') + +def labelsDir(datadir): + return os.path.join(datadir, 'labels') + +def classesDir(datadir): + return os.path.join(datadir, 'classes') + +# e. g. "012 - Midi skirt.jpg": +CLASSES_RE = re.compile(r'^0*(?P\d+)\s*-\s*(?P[^.]+).*$') + +# e. g. "1 0.57 0.42 0.17 0.6654" +BBOX_RE = re.compile( + r'^\s*(?P\d+)\s+(?P{float})\s+(?P{float})\s+(?P{float})\s+(?P{float}).*$'.format( + float=r'([0-9]*[.])?[0-9]+')) + + +def main(): + app = QApplication(sys.argv) + + main_window = MainWindow() + main_window.show() + + sys.exit(app.exec()) + -- cgit v1.2.3