labelr 0.9.0__py3-none-any.whl → 0.11.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,159 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: labelr
3
- Version: 0.9.0
4
- Summary: A command-line tool to manage labeling tasks with Label Studio.
5
- Requires-Python: >=3.10
6
- Description-Content-Type: text/markdown
7
- License-File: LICENSE
8
- Requires-Dist: datasets>=3.2.0
9
- Requires-Dist: imagehash>=4.3.1
10
- Requires-Dist: label-studio-sdk>=1.0.8
11
- Requires-Dist: more-itertools>=10.5.0
12
- Requires-Dist: openfoodfacts>=2.9.0
13
- Requires-Dist: typer>=0.15.1
14
- Requires-Dist: google-cloud-batch==0.18.0
15
- Requires-Dist: huggingface-hub
16
- Requires-Dist: deepdiff>=8.6.1
17
- Requires-Dist: rapidfuzz>=3.14.3
18
- Requires-Dist: aiohttp
19
- Requires-Dist: aiofiles
20
- Requires-Dist: orjson
21
- Provides-Extra: ultralytics
22
- Requires-Dist: ultralytics==8.3.223; extra == "ultralytics"
23
- Provides-Extra: fiftyone
24
- Requires-Dist: fiftyone~=1.10.0; extra == "fiftyone"
25
- Provides-Extra: google
26
- Requires-Dist: google-genai>=1.56.0; extra == "google"
27
- Requires-Dist: gcloud-aio-storage; extra == "google"
28
- Requires-Dist: google-cloud-storage; extra == "google"
29
- Dynamic: license-file
30
-
31
- # Labelr
32
-
33
- Labelr a command line interface that aims to provide a set of tools to help data scientists and machine learning engineers to deal with ML data annotation, data preprocessing and format conversion.
34
-
35
- This project started as a way to automate some of the tasks we do at Open Food Facts to manage data at different stages of the machine learning pipeline.
36
-
37
- The CLI currently is integrated with Label Studio (for data annotation), Ultralytics (for object detection) and Hugging Face (for model and dataset storage). It only works with some specific tasks (object detection only currently), but it's meant to be extended to other tasks in the future.
38
-
39
- It currently allows to:
40
-
41
- - create Label Studio projects
42
- - upload images to Label Studio
43
- - pre-annotate the tasks either with an existing object detection model run by Triton, or with Yolo-World (through Ultralytics)
44
- - perform data quality checks on Label Studio
45
- - export the data to Hugging Face Dataset or to local disk
46
-
47
- ## Installation
48
-
49
- Python 3.10 or higher is required to run this CLI.
50
-
51
- To install the CLI, simply run:
52
-
53
- ```bash
54
- pip install labelr
55
- ```
56
- We recommend to install the CLI in a virtual environment. You can either use pip or conda for that.
57
-
58
- There are two optional dependencies that you can install to use the CLI:
59
- - `ultralytics`: pre-annotate object detection datasets with an ultralytics model (yolo, yolo-world)
60
- - `triton`: pre-annotate object detection datasets using a model served by a Triton inference server
61
-
62
- To install the optional dependencies, you can run:
63
-
64
- ```bash
65
- pip install labelr[ultralytics,triton]
66
- ```
67
-
68
- ## Usage
69
-
70
- ### Label Studio integration
71
-
72
- To create a Label Studio project, you need to have a Label Studio instance running. Launching a Label Studio instance is out of the scope of this project, but you can follow the instructions on the [Label Studio documentation](https://labelstud.io/guide/install.html).
73
-
74
- By default, the CLI will use Open Food Facts Label Studio instance, but you can change the URL by setting the `--label-studio-url` CLI option.
75
-
76
- For all the commands that interact with Label Studio, you need to provide an API key using the `--api-key` CLI option. You can get an API key by logging in to the Label Studio instance and going to the Account & Settings page.
77
-
78
- #### Create a project
79
-
80
- Once you have a Label Studio instance running, you can create a project easily. First, you need to create a configuration file for the project. The configuration file is an XML file that defines the labeling interface and the labels to use for the project. You can find an example of a configuration file in the [Label Studio documentation](https://labelstud.io/guide/setup).
81
-
82
- For an object detection task, a command allows you to create the configuration file automatically:
83
-
84
- ```bash
85
- labelr ls create-config --labels 'label1' --labels 'label2' --output-file label_config.xml
86
- ```
87
-
88
- where `label1` and `label2` are the labels you want to use for the object detection task, and `label_config.xml` is the output file that will contain the configuration.
89
-
90
- Then, you can create a project on Label Studio with the following command:
91
-
92
- ```bash
93
- labelr ls create --title my_project --api-key API_KEY --config-file label_config.xml
94
- ```
95
-
96
- where `API_KEY` is the API key of the Label Studio instance (API key is available at Account page), and `label_config.xml` is the configuration file of the project.
97
-
98
- `ls` stands for Label Studio in the CLI.
99
-
100
- #### Create a dataset file
101
-
102
- If you have a list of images, for an object detection task, you can quickly create a dataset file with the following command:
103
-
104
- ```bash
105
- labelr ls create-dataset-file --input-file image_urls.txt --output-file dataset.json
106
- ```
107
-
108
- where `image_urls.txt` is a file containing the URLs of the images, one per line, and `dataset.json` is the output file.
109
-
110
- #### Import data
111
-
112
- Next, import the generated data to a project with the following command:
113
-
114
- ```bash
115
- labelr ls import-data --project-id PROJECT_ID --dataset-path dataset.json
116
- ```
117
-
118
- where `PROJECT_ID` is the ID of the project you created.
119
-
120
- #### Pre-annotate the data
121
-
122
- To accelerate annotation, you can pre-annotate the images with an object detection model. We support two pre-annotation backends:
123
-
124
- - Triton: you need to have a Triton server running with a model that supports object detection. The object detection model is expected to be a yolo-v8 model. You can set the URL of the Triton server with the `--triton-url` CLI option.
125
-
126
- - Ultralytics: you can use the [Yolo-World model from Ultralytics](https://github.com/ultralytics/ultralytics), Ultralytics should be installed in the same virtualenv.
127
-
128
- To pre-annotate the data with Triton, use the following command:
129
-
130
- ```bash
131
- labelr ls add-prediction --project-id PROJECT_ID --backend ultralytics --labels 'product' --labels 'price tag' --label-mapping '{"price tag": "price-tag"}'
132
- ```
133
-
134
- where `labels` is the list of labels to use for the object detection task (you can add as many labels as you want).
135
- For Ultralytics, you can also provide a `--label-mapping` option to map the labels from the model to the labels of the project.
136
-
137
- By default, for Ultralytics, the `yolov8x-worldv2.pt` model is used. You can change the model by setting the `--model-name` CLI option.
138
-
139
- #### Export the data
140
-
141
- Once the data is annotated, you can export it to a Hugging Face dataset or to local disk (Ultralytics format). To export it to disk, use the following command:
142
-
143
- ```bash
144
- labelr datasets export --project-id PROJECT_ID --from ls --to ultralytics --output-dir output --label-names 'product,price-tag'
145
- ```
146
-
147
- where `output` is the directory where the data will be exported. Currently, label names must be provided, as the CLI does not support exporting label names from Label Studio yet.
148
-
149
- To export the data to a Hugging Face dataset, use the following command:
150
-
151
- ```bash
152
- labelr datasets export --project-id PROJECT_ID --from ls --to huggingface --repo-id REPO_ID --label-names 'product,price-tag'
153
- ```
154
-
155
- where `REPO_ID` is the ID of the Hugging Face repository where the dataset will be uploaded (ex: `openfoodfacts/food-detection`).
156
-
157
- ### Lauch training jobs
158
-
159
- You can also launch training jobs for YOLO object detection models using datasets hosted on Hugging Face. Please refer to the [train-yolo package README](packages/train-yolo/README.md) for more details on how to use this feature.
@@ -1,28 +0,0 @@
1
- labelr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- labelr/__main__.py,sha256=G4e95-IfhI-lOmkOBP6kQ8wl1x_Fl7dZlLOYr90K83c,66
3
- labelr/annotate.py,sha256=3fJ9FYbcozcOoKuhNtzPHV8sSnp-45FsNnMc8UeBHGU,3503
4
- labelr/check.py,sha256=3wK6mE0UsKvoBNm0_lyWhCMq7gxkv5r50pvO70damXY,2476
5
- labelr/config.py,sha256=3RXF_NdkSuHvfVMGMlYmjlw45fU77zQkLX7gmZq7NxM,64
6
- labelr/dataset_features.py,sha256=ZC9QAUw9oKHqyUPla2h3xQFaRT9sHq8hkPNN4RDDwmo,1257
7
- labelr/export.py,sha256=aPfQ-RaK3C2WJrzbETYdC9kRe0MTpCRs0nu5l2SqiRg,20092
8
- labelr/google_genai.py,sha256=vn_UNQOxUDOTTTWz-emAVErjOtQmnlxM_m8yo2q01Ok,14401
9
- labelr/main.py,sha256=OTiJSkD_TrzQmQQm291FhknD-HQQTWfBEBgImxqL0KM,2634
10
- labelr/project_config.py,sha256=CIHEcgSOfXb53naHWEBkTDm2V9m3abAu8C54VSzHjAs,1260
11
- labelr/sample.py,sha256=VL-iKDvLaIeViJ0TaBY9uCbv0ey528fkaRTYE-Zr12I,10347
12
- labelr/types.py,sha256=8CHfLyifF_N94OYDhG-7IcWboOh9o0Z_0LBtQapT8TQ,313
13
- labelr/utils.py,sha256=-zLOWLbvLwtNFtzzwZ6RjJD9GstoYR-gt4wz9r6u9lE,1363
14
- labelr/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- labelr/apps/datasets.py,sha256=kJQWwm3mjA2uWIA8O_DslM7OS5ht5mgWqcFC_zF4gCo,11187
16
- labelr/apps/evaluate.py,sha256=UC4CuSKa4vgR5xTBZ-dFgp_1pYnkM55s2IJgix0YtkI,1157
17
- labelr/apps/google_batch.py,sha256=BMcfBkDwfu-zOOR80bYmtEy6k_Qc70m7K7wmp4Ww0r8,9335
18
- labelr/apps/hugging_face.py,sha256=B0GaDZeUZj2A7nEeC1OtCANb0DqvBkhWwFWM_9Nm2kU,1608
19
- labelr/apps/label_studio.py,sha256=su9shoi0K9PmI8RBLipV2KQf_MRjkF5vy5-JUcbXr5A,16852
20
- labelr/apps/train.py,sha256=wmOSpO9JsrwCXYMgRg2srMbV5B5TvnlfhAKPqUt6wSg,7328
21
- labelr/evaluate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- labelr/evaluate/object_detection.py,sha256=QJIwrDY-Vsy0-It6tZSkN3qgAlmIu2W1-kGdmibiPSQ,3349
23
- labelr-0.9.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
24
- labelr-0.9.0.dist-info/METADATA,sha256=cNkf4LPmbO_k3UuR7O7NtcCwRF-Z5c-yIyQRAocsjww,7322
25
- labelr-0.9.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
- labelr-0.9.0.dist-info/entry_points.txt,sha256=OACukVeR_2z54i8yQuWqqk_jdEHlyTwmTFOFBmxPp1k,43
27
- labelr-0.9.0.dist-info/top_level.txt,sha256=bjZo50aGZhXIcZYpYOX4sdAQcamxh8nwfEh7A9RD_Ag,7
28
- labelr-0.9.0.dist-info/RECORD,,