You can refer to the following documentation. You can also refer to our recipe on how to create a project (run it here)
-
Edit
new_interface_settings.json
. -
Execute:
python update_interface_settings.py
-
Edit
new_users.yml
. -
Execute:
python add_users.py
Note: You need to have ADMIN right at Organization level to create users.
Check out our recipe on how to import assets (run it here)
- Execute:
python delete_all_assets.py
Check out our recipe on how to import predictions (run it here)
Check out our recipe on how to export labels (run it here)
Example based on Enron email dataset. Its downloads the data, get the first 50 emails, pre-label them with Google NLP, push both assets and predictions to Kili and prioritize the assets.
-
Create a NER project and retrieve its ID.
-
Make sure that your GCP authentication is set up properly (or follow this tutorial).
-
Execute:
python google_ner_pre_labeling.py
You can query every asset, label, or project-related information through the API. A comprehensive example is our recipe on how to use the query methods (run it here) You can also refer to the documentation.
If you prefer, you can directly query GraphQL API without using
kili-playground
.
-
Generate an API key in Kili interface in My account, under the tab API KEY. Store it in some place secured.
-
In the bottom left corner of the screen, click on
HTTP headers
and write the retrieved token in the authorization headers:
{
"Authorization": "X-API-Key: YOUR_API_KEY"
}
- Launch any query/mutation:
query {
users(where: { email: "YOUR_EMAIL" }, first: 10, skip: 0) {
id
activated
email
}
}
-
Create a project for single-class object detection
-
Update settings to respect YOLOv3's handling of classes (key is an integer starting from zero and value is in lower case)
{
"jobs": {
"OBJECT_DETECTION": {
"mlTask": "OBJECT_DETECTION",
"content": {
"input": "radio",
"categories": {
"0": {
"name": "face"
},
...
}
},
"required": true,
"tools": [
"polygon"
],
"instruction": "Detect following objects"
}
}
}
You can use Kili Playground's recipe update_interface_settings
to programmatically update the interface.
- Build the docker in the folder:
cd image-object-detection-with-yolo
docker build -t kili-playground-yolo .
- Launch it by setting
EMAIL
/PASSWORD
/PROJECT_ID
/API_ENDPOINT
environment variables:
docker run -it -e "EMAIL=myemail@kili-technology.com" \
-e "PASSWORD=my_password" \
-e "PROJECT_ID=1234567890" \
-e "JOB_ID=job_12345" \
-e "API_ENDPOINT=https://cloud.kili-technology.com/api/label/v2/graphql" \
--network="host" kili-playground-yolo
You can also launch the script manually:
git clone git@github.com:ultralytics/yolov3.git /path/to/yolov3
python main.py --weights /path/to/weights/yolov3.pt \
--email=myemail@kili-technology.com \
--password=mypassword \
--project_id=1234567890 \
--job_id=job_12345 \
--api_endpoint=https://cloud.kili-technology.com/api/label/v2/graphql \
--yolo_path=/path/to/yolov3
- The script will continuously create predictions on non-labelled assets.
-
Edit
new_assets.yml
where metadata has the format of./examples/invoice.json
and the content points to the URL ofinvoice.png
. -
Execute:
python import_assets.py
-
Edit
new_assets.yml
and change the fieldtoBeLabeledBy
. When this field no exists, assets can be labeled by everyone. -
Execute:
python set_asset_to_be_labeled_by.py
-
Generate an API key in Kili interface in My account, under the tab API KEY. Store it in some place secured.
-
Start automating your tasks :
from kili.client import Kili
kili = Kili(api_key=api_key)
Use:
assets = kili.assets(project_id=project_id, external_id_contains=[external_id])
kili.delete_many_from_dataset(asset_ids=[a['id] for a in assets])
Currently instructions can be set as a link to a PDF or an external web page.
You can update instructions with:
python update_project_instructions.py
You can get an excel file summing up the asset / labeler / day doing:
python get_labeler_stats.py