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

Settings API usage #52

Open
itepifanio opened this issue Sep 22, 2022 · 0 comments
Open

Settings API usage #52

itepifanio opened this issue Sep 22, 2022 · 0 comments

Comments

@itepifanio
Copy link
Collaborator

Ipyannotator uses an API that contains a pair of Input/Output and a Settings class. The Settings contains parameters that are used for all annotators, but some of them are redundant.

This task tries to reduce the Settings class to three parameters:

class Settings:
    project_path: Path = Path('user_project')
    project_file: Optional[Path] = None
    result_dir: Optional[str] = None

The remaining parameters should be stored in Input/Output classes. This will avoid the following redundant code (from
01b_tutorial_image_classification.ipynb):

settings_ = get_settings(dataset)
settings_.project_file, settings_.image_dir
input_ = InputImage(image_dir=settings_.image_dir,
                    image_width=settings_.im_width,
                    image_height=settings_.im_height)

output_ = OutputImageLabel(label_dir=settings_.label_dir,
                           label_width=settings_.label_width,
                           label_height=settings_.label_height)

To do this the get_settings function needs to be refactored. A suggestion is to rename get_settings to get_api and return a tuple with input, output, and settings.

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

No branches or pull requests

2 participants