-
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
Created FakeDetector and FakeGroundTruthDatareader, need to revise datareaders structure and layout(groundtruth) file format #5
base: main
Are you sure you want to change the base?
Conversation
…areaders structure and layout(groundtruth) file format
src/utils/data_reader.py
Outdated
elif mode == "image": | ||
return ImgDataReader(dir_path) | ||
elif mode == "groundtruth": | ||
return GroundtruthReader(dir_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.
Удалить
src/utils/data_reader.py
Outdated
else: | ||
raise StopIteration | ||
|
||
class FakeGTReader(): |
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.
Реализовать наследника от GroundtruthReader
(из utils).
tests/test_main.py
Outdated
reader = DataReader.create( args.mode, (args.video_path or args.images_path) ) | ||
adapter = None | ||
detector = Detector.create( "fake" ) | ||
visualizer = Visualize( reader, detector, args.groundtruth_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.
visualizer = Visualize( reader, detector, GroundtruthReader.read(args.groundtruth_path) )
src/gui_application/visualizer.py
Outdated
def __init__(self, datareader:DataReader, detector:FakeDetector, gt_path:str): | ||
self.datareader = datareader | ||
self.detector = detector | ||
self.gt_data = FakeGTReader().read() |
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.
присваивание
tests/test_main.py
Outdated
parser.add_argument('-t', '--mode', | ||
help='Mode (\'image\', \'video\')', | ||
type=str, | ||
dest='mode', |
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.
choices=['image', 'video'],
Rename class DataReader to FrameDataReader. Created samples dir and CLI main. Minor changes in GroundTruthReader.
import os | ||
|
||
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | ||
sys.path.append(project_root) |
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.
Это к вопросу об использовании init.py, который мы обсуждали после собрания. По смыслу в директории utils должен быть такой файлик, тогда можно писать стандартные импорты. Ниже примеры. Надо попробовать это реализовать.
import utils.data_reader
from utils import data_reader
args = parser.parse_args() | ||
return args | ||
|
||
#некоторое подобие main |
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.
Удалить такой комментарий :)
@ismukhin, посмотрите, пожалуйста. |
Советую посмотреть кодстайл чекеры pylint и flake8 и их основные требования к коду. Потому что когда один из них будет внедряться - исправление кода может стать большой головной болью, поэтому нужно стараться привыкать писать в рамках того или иного код стайл чекера (но как правило требования совпадают) |
No description provided.