birdfsd_yolov5.label_studio_helpers package

Submodules

birdfsd_yolov5.label_studio_helpers.add_and_sync_new_project module

birdfsd_yolov5.label_studio_helpers.add_and_sync_new_project.add_and_sync_data_storage(project_id: int, project_name: str, s3_endpoint_scheme: str = 'https://') dict[source]

Add the new project to label-studio, then sync its local data.

Parameters
  • project_id (str) – The id of the project to add the storage to.

  • project_name (str) – The name of the project to add the storage to.

  • s3_endpoint_scheme (str) – The scheme to use for the s3 endpoint. Defaults to ‘https://’.

Returns

The response from the sync request.

Return type

dict

birdfsd_yolov5.label_studio_helpers.add_and_sync_new_project.add_new_project(new_project_folder_name: str) Optional[dict][source]

Creates a new project in Label Studio.

Parameters

new_project_folder_name (str) – The name of the new project.

Returns

The new project’s metadata.

Return type

dict

Raises

ValueError – If the project already exists.

birdfsd_yolov5.label_studio_helpers.create_rare_classes_view module

class birdfsd_yolov5.label_studio_helpers.create_rare_classes_view.CreateRareClassesView(project_id: int, model_version: str, method: str = 'median')[source]

Bases: object

Create a label-studio view tab with filters that shows rare classes.

create_view() Optional[dict][source]

Creates a new view in the project with the rare classes.

Returns

A dictionary containing the new view.

birdfsd_yolov5.label_studio_helpers.generate_patch_label_name_queries module

birdfsd_yolov5.label_studio_helpers.generate_patch_label_name_queries.generate_queries(from_string: str, to_string: str) None[source]

Generate queries to update the database for replacing old label names.

Parameters
  • from_string (str) – The string to be replaced.

  • to_string (str) – The string to replace with.

Returns

None

birdfsd_yolov5.label_studio_helpers.sync_tasks module

birdfsd_yolov5.label_studio_helpers.sync_tasks.sync_all_to_single_files() None[source]

Creates one file for all tasks and one file for all predictions.

Returns

None

birdfsd_yolov5.label_studio_helpers.sync_tasks.sync_tasks(force_update: bool = False) None[source]

Synchronizes the tasks of all projects in the database.

Parameters

force_update (bool) – If True, the tasks will be updated even if they were already up-to-date.

Returns

None

birdfsd_yolov5.label_studio_helpers.utils module

birdfsd_yolov5.label_studio_helpers.utils.get_all_projects_tasks(dump: Optional[Union[bool, str]] = None, get_predictions_instead: bool = False)[source]

Get all the tasks from all projects from the database.

The function gets all the tasks from the MongoDB database. returns a list of dictionaries, each dictionary containing the project name and the tasks associated with it.

Parameters
  • dump (Optional[Union[bool, str]]) – The JSON file containing the database dump.

  • get_predictions_instead (bool) – If True, the function returns the predictions instead of the actual tasks.

Returns

A list of dictionaries, each dictionary containing the project

name and the tasks associated with it.

Return type

list

birdfsd_yolov5.label_studio_helpers.utils.update_model_version_in_all_projects(new_model_version: str) None[source]

Updates the selected default model version in all projects.

Parameters

new_model_version (str) – The new model version to be updated.

Returns

None

birdfsd_yolov5.label_studio_helpers.watchdog module

Module contents