Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Serebro1
Copy link

No description provided.

elif mode == "image":
return ImgDataReader(dir_path)
elif mode == "groundtruth":
return GroundtruthReader(dir_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Удалить

else:
raise StopIteration

class FakeGTReader():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Реализовать наследника от GroundtruthReader (из utils).

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 )
Copy link
Contributor

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) )

def __init__(self, datareader:DataReader, detector:FakeDetector, gt_path:str):
self.datareader = datareader
self.detector = detector
self.gt_data = FakeGTReader().read()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

присваивание

parser.add_argument('-t', '--mode',
help='Mode (\'image\', \'video\')',
type=str,
dest='mode',
Copy link
Contributor

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)
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Удалить такой комментарий :)

@valentina-kustikova
Copy link
Contributor

@ismukhin, посмотрите, пожалуйста.

@ismukhin
Copy link

Советую посмотреть кодстайл чекеры pylint и flake8 и их основные требования к коду. Потому что когда один из них будет внедряться - исправление кода может стать большой головной болью, поэтому нужно стараться привыкать писать в рамках того или иного код стайл чекера (но как правило требования совпадают)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants