Skip to content

Commit

Permalink
fix: update script to create label studio project
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Sep 30, 2024
1 parent 19c9226 commit e720c9e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions nutrition-detector/dataset-generation/2_create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@


def create_project(
api_key: Annotated[str, typer.Argument(envvar="LABEL_STUDIO_API_KEY")]
api_key: Annotated[str, typer.Argument(envvar="LABEL_STUDIO_API_KEY")],
label_config_path: Path = typer.Argument(
file_okay=True, dir_okay=False, exists=True
),
title: str = typer.Option(help="Project title"),
):
ls = LabelStudio(base_url=LABEL_STUDIO_URL, api_key=api_key)
label_config = Path("./label_config.xml").read_text()
label_config = Path(label_config_path).read_text()

project = ls.projects.create(
title="Nutrition table token annotation", label_config=label_config
)
project = ls.projects.create(title=title, label_config=label_config)
logger.info(f"Project created: {project}")


Expand Down

0 comments on commit e720c9e

Please sign in to comment.