lightly-studio 0.3.1__tar.gz → 0.3.3__tar.gz
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.
Potentially problematic release.
This version of lightly-studio might be problematic. Click here for more details.
- lightly_studio-0.3.3/PKG-INFO +814 -0
- lightly_studio-0.3.3/USAGE.md +773 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/pyproject.toml +42 -9
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/__init__.py +4 -4
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/app.py +7 -5
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/db_tables.py +0 -3
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/annotation.py +32 -16
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/annotation_label.py +2 -5
- lightly_studio-0.3.3/src/lightly_studio/api/routes/api/annotations/__init__.py +7 -0
- lightly_studio-0.3.3/src/lightly_studio/api/routes/api/annotations/create_annotation.py +52 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/classifier.py +2 -5
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/dataset.py +5 -8
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/dataset_tag.py +2 -3
- lightly_studio-0.3.3/src/lightly_studio/api/routes/api/embeddings2d.py +104 -0
- lightly_studio-0.3.3/src/lightly_studio/api/routes/api/export.py +73 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/metadata.py +2 -4
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/sample.py +5 -13
- lightly_studio-0.3.3/src/lightly_studio/api/routes/api/selection.py +87 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/settings.py +2 -6
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/images.py +6 -6
- lightly_studio-0.3.3/src/lightly_studio/core/add_samples.py +374 -0
- lightly_studio-0.3.3/src/lightly_studio/core/dataset.py +395 -0
- lightly_studio-0.3.3/src/lightly_studio/core/dataset_query/boolean_expression.py +67 -0
- lightly_studio-0.3.3/src/lightly_studio/core/dataset_query/dataset_query.py +216 -0
- lightly_studio-0.3.3/src/lightly_studio/core/dataset_query/field.py +113 -0
- lightly_studio-0.3.3/src/lightly_studio/core/dataset_query/field_expression.py +79 -0
- lightly_studio-0.3.3/src/lightly_studio/core/dataset_query/match_expression.py +23 -0
- lightly_studio-0.3.3/src/lightly_studio/core/dataset_query/order_by.py +79 -0
- lightly_studio-0.3.3/src/lightly_studio/core/dataset_query/sample_field.py +28 -0
- lightly_studio-0.3.3/src/lightly_studio/core/dataset_query/tags_expression.py +46 -0
- lightly_studio-0.3.3/src/lightly_studio/core/sample.py +204 -0
- lightly_studio-0.3.3/src/lightly_studio/core/start_gui.py +50 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dataset/edge_embedding_generator.py +13 -8
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dataset/embedding_generator.py +2 -3
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dataset/embedding_manager.py +74 -6
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dataset/env.py +4 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dataset/file_utils.py +13 -2
- lightly_studio-0.3.3/src/lightly_studio/dataset/fsspec_lister.py +275 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dataset/loader.py +49 -84
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dataset/mobileclip_embedding_generator.py +9 -6
- lightly_studio-0.3.3/src/lightly_studio/db_manager.py +145 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.CA_CXIBb.css +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.DS78jgNY.css +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/index.BVs_sZj9.css +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/transform.D487hwJk.css +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/6t3IJ0vQ.js +1 -0
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D6su9Aln.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/8NsknIT2.js +1 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/x9G_hzyY.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BND_-4Kp.js +1 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BylOuP6i.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BdfTHw61.js +1 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DOlTMNyt.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BfHVnyNT.js +1 -1
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BjkP1AHA.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BuuNVL9G.js +1 -0
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/O-EABkf9.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BzKGpnl4.js +1 -1
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CCx7Ho51.js +1 -0
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/l7KrR96u.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CH6P3X75.js +1 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D5-A_Ffd.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CR2upx_Q.js +2 -2
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CWPZrTTJ.js +1 -0
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/C8I8rFJQ.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cs1XmhiF.js +1 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CDnpyLsT.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CwPowJfP.js +1 -1
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CxFKfZ9T.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cxevwdid.js +1 -0
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DjfY96ND.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D4whDBUi.js +1 -1
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D6r9vr07.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DA6bFLPR.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DEgUu98i.js +3 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DGTPl6Gk.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DKGxBSlK.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DQXoLcsF.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DQe_kdRt.js +92 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DcY4jgG3.js +1 -0
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Bu7uvVrG.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/RmD8FzRo.js +1 -1
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/V-MnMC1X.js +1 -0
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Bsi3UGy5.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/keKYsoph.js +1 -1
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/app.BVr6DYqP.js +2 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.u7zsVvqp.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/0.Da2agmdd.js +1 -0
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/1.B4rNYwVp.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/1.B11tVRJV.js +1 -1
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/10.l30Zud4h.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/12.CgKPGcAP.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/2.C8HLK8mj.js +857 -0
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/3.CWHpKonm.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/3.CLvg3QcJ.js +1 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/4.OUWOLQeV.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/4.BQhDtXUI.js +1 -1
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.-6XqWX5G.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/6.uBV1Lhat.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/7.BXsgoQZh.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.BkbcnUs8.js +1 -0
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/9.CPu3CiBc.js → lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/9.Bkrv-Vww.js +1 -1
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/workers/clustering.worker-DKqeLtG0.js +2 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/workers/search.worker-vNSty3B0.js +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/_app/version.json +1 -0
- lightly_studio-0.3.3/src/lightly_studio/dist_lightly_studio_view_app/index.html +44 -0
- lightly_studio-0.3.1/src/lightly_studio/examples/example_v2.py → lightly_studio-0.3.3/src/lightly_studio/examples/example.py +4 -1
- lightly_studio-0.3.3/src/lightly_studio/examples/example_coco.py +13 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/examples/example_metadata.py +83 -98
- lightly_studio-0.3.3/src/lightly_studio/examples/example_selection.py +27 -0
- lightly_studio-0.3.3/src/lightly_studio/examples/example_split_work.py +43 -0
- lightly_studio-0.3.3/src/lightly_studio/examples/example_yolo.py +20 -0
- lightly_studio-0.3.3/src/lightly_studio/export/export_dataset.py +65 -0
- lightly_studio-0.3.3/src/lightly_studio/export/lightly_studio_label_input.py +120 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/few_shot_classifier/classifier_manager.py +5 -26
- lightly_studio-0.3.3/src/lightly_studio/metadata/compute_typicality.py +67 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/annotation/annotation_base.py +18 -20
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/annotation/instance_segmentation.py +8 -8
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/annotation/object_detection.py +4 -4
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/dataset.py +6 -2
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/sample.py +10 -3
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_label_resolver/__init__.py +2 -1
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_label_resolver/get_all.py +15 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_resolver/__init__.py +2 -3
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_resolver/create_many.py +3 -3
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_resolver/delete_annotation.py +1 -1
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_resolver/delete_annotations.py +7 -3
- lightly_studio-0.3.3/src/lightly_studio/resolvers/annotation_resolver/get_by_id.py +36 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_resolver/update_annotation_label.py +0 -1
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotations/annotations_filter.py +1 -11
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/dataset_resolver.py +10 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/embedding_model_resolver.py +22 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/sample_resolver.py +53 -9
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/tag_resolver.py +23 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/selection/mundig.py +7 -10
- lightly_studio-0.3.3/src/lightly_studio/selection/select.py +105 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/selection/select_via_db.py +23 -19
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/selection/selection_config.py +10 -4
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/services/annotations_service/__init__.py +12 -0
- lightly_studio-0.3.3/src/lightly_studio/services/annotations_service/create_annotation.py +63 -0
- lightly_studio-0.3.3/src/lightly_studio/services/annotations_service/delete_annotation.py +22 -0
- lightly_studio-0.3.3/src/lightly_studio/services/annotations_service/update_annotation.py +54 -0
- lightly_studio-0.3.3/src/lightly_studio/services/annotations_service/update_annotation_bounding_box.py +36 -0
- lightly_studio-0.3.1/PKG-INFO +0 -520
- lightly_studio-0.3.1/USAGE.md +0 -487
- lightly_studio-0.3.1/src/lightly_studio/api/db.py +0 -133
- lightly_studio-0.3.1/src/lightly_studio/api/routes/api/annotation_task.py +0 -38
- lightly_studio-0.3.1/src/lightly_studio/api/routes/api/metrics.py +0 -80
- lightly_studio-0.3.1/src/lightly_studio/core/dataset.py +0 -523
- lightly_studio-0.3.1/src/lightly_studio/core/sample.py +0 -77
- lightly_studio-0.3.1/src/lightly_studio/core/start_gui.py +0 -15
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.DenzbfeK.css +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/SelectableSvgGroup.OwPEPQZu.css +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/SelectableSvgGroup.b653GmVf.css +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.T-zjSUd3.css +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/B2FVR0s0.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/B9zumHo5.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BJXwVxaE.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Bx1xMsFy.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CcaPhhk3.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CvOmgdoc.js +0 -93
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CxtLVaYz.js +0 -3
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D6RI2Zrd.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D98V7j6A.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DIRAtgl0.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DjUWrjOv.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/XO7A28GO.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/hQVEETDE.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/nAHhluT7.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/r64xT6ao.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/vC4nQVEB.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/app.CjnvpsmS.js +0 -2
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.0o1H7wM9.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/0.XRq_TUwu.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/10.DfBwOEhN.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/12.CwF2_8mP.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/2.CS4muRY-.js +0 -6
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.Dm6t9F5W.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/6.Bw5ck4gK.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/7.CF0EDTR6.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.Cw30LEcV.js +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/_app/version.json +0 -1
- lightly_studio-0.3.1/src/lightly_studio/dist_lightly_studio_view_app/index.html +0 -44
- lightly_studio-0.3.1/src/lightly_studio/examples/example.py +0 -23
- lightly_studio-0.3.1/src/lightly_studio/examples/example_selection.py +0 -39
- lightly_studio-0.3.1/src/lightly_studio/examples/example_split_work.py +0 -67
- lightly_studio-0.3.1/src/lightly_studio/metrics/detection/map.py +0 -268
- lightly_studio-0.3.1/src/lightly_studio/models/annotation/__init__.py +0 -0
- lightly_studio-0.3.1/src/lightly_studio/models/annotation_task.py +0 -28
- lightly_studio-0.3.1/src/lightly_studio/resolvers/annotation_resolver/create.py +0 -19
- lightly_studio-0.3.1/src/lightly_studio/resolvers/annotation_resolver/get_by_id.py +0 -18
- lightly_studio-0.3.1/src/lightly_studio/resolvers/annotation_task_resolver.py +0 -31
- lightly_studio-0.3.1/src/lightly_studio/selection/select.py +0 -96
- lightly_studio-0.3.1/src/lightly_studio/services/annotations_service/update_annotation.py +0 -65
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/.gitignore +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/cache.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/features.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/exceptions.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/features.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/status.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/text_embedding.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/api/validators.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/healthz.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/routes/webapp.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/api/server.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/core/__init__.py +0 -0
- {lightly_studio-0.3.1/src/lightly_studio/dataset → lightly_studio-0.3.3/src/lightly_studio/core/dataset_query}/__init__.py +0 -0
- {lightly_studio-0.3.1/src/lightly_studio/few_shot_classifier → lightly_studio-0.3.3/src/lightly_studio/dataset}/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/env.js +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/LightlyLogo.BNjCIww-.png +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-Bold.DGvYQtcs.ttf +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-Italic-VariableFont_wdth_wght.B4AZ-wl6.ttf +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-Medium.DVUZMR_6.ttf +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-Regular.DxJTClRG.ttf +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-SemiBold.D3TTYgdB.ttf +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/OpenSans-VariableFont_wdth_wght.BZBpG5Iz.ttf +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/useFeatureFlags.CV-KWLNP.css +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/69_IOA4Y.js +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/B90CZVMX.js +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CWj6FrbW.js +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CYgJF_JY.js +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DIeogL5L.js +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/H7C68rOM.js +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/11.CWG1ehzT.js +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/apple-touch-icon-precomposed.png +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/apple-touch-icon.png +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/dist_lightly_studio_view_app/favicon.png +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/export_schema.py +0 -0
- {lightly_studio-0.3.1/src/lightly_studio/metrics → lightly_studio-0.3.3/src/lightly_studio/few_shot_classifier}/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/few_shot_classifier/classifier.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/few_shot_classifier/random_forest_classifier.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/metadata/complex_metadata.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/metadata/gps_coordinate.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/metadata/metadata_protocol.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/__init__.py +0 -0
- {lightly_studio-0.3.1/src/lightly_studio/metrics/detection → lightly_studio-0.3.3/src/lightly_studio/models/annotation}/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/annotation/links.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/annotation/semantic_segmentation.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/annotation_label.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/classifier.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/embedding_model.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/metadata.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/sample_embedding.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/settings.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/models/tag.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/py.typed +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_label_resolver/create.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_label_resolver/delete.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_label_resolver/get_by_id.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_label_resolver/get_by_ids.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_label_resolver/get_by_label_name.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_label_resolver/names_by_ids.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_label_resolver/update.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_resolver/count_annotations_by_dataset.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_resolver/get_all.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotation_resolver/update_bounding_box.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/annotations/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/metadata_resolver/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/metadata_resolver/metadata_filter.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/metadata_resolver/sample/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/metadata_resolver/sample/bulk_set_metadata.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/metadata_resolver/sample/get_by_sample_id.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/metadata_resolver/sample/get_metadata_info.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/metadata_resolver/sample/get_value_for_sample.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/metadata_resolver/sample/set_value_for_sample.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/sample_embedding_resolver.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/samples_filter.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/resolvers/settings_resolver.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/selection/README.md +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/services/annotations_service/get_annotation_by_id.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/services/annotations_service/update_annotation_label.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/services/annotations_service/update_annotations.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/setup_logging.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/type_definitions.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/ACKNOWLEDGEMENTS +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/LICENSE +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/LICENSE_weights_data +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/README.md +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/clip.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/configs/mobileclip_b.json +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/configs/mobileclip_s0.json +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/configs/mobileclip_s1.json +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/configs/mobileclip_s2.json +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/image_encoder.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/logger.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/models/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/models/mci.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/models/vit.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/modules/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/modules/common/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/modules/common/mobileone.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/modules/common/transformer.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/modules/image/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/modules/image/image_projection.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/modules/image/replknet.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/modules/text/__init__.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/modules/text/repmixer.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/modules/text/tokenizer.py +0 -0
- {lightly_studio-0.3.1 → lightly_studio-0.3.3}/src/lightly_studio/vendor/mobileclip/text_encoder.py +0 -0
|
@@ -0,0 +1,814 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lightly-studio
|
|
3
|
+
Version: 0.3.3
|
|
4
|
+
Summary: LightlyStudio is a lightweight, fast, and easy-to-use data exploration tool for data scientists and engineers.
|
|
5
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
6
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
7
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Requires-Dist: annotated-types==0.7.0
|
|
15
|
+
Requires-Dist: duckdb-engine<0.17,>=0.15.0
|
|
16
|
+
Requires-Dist: duckdb<1.3,>=1.2.2
|
|
17
|
+
Requires-Dist: environs<12.0.0
|
|
18
|
+
Requires-Dist: eval-type-backport>=0.2.2
|
|
19
|
+
Requires-Dist: fastapi>=0.115.5
|
|
20
|
+
Requires-Dist: faster-coco-eval>=1.6.5
|
|
21
|
+
Requires-Dist: fsspec>=2023.1.0
|
|
22
|
+
Requires-Dist: labelformat>=0.1.7
|
|
23
|
+
Requires-Dist: lightly-mundig==0.1.4
|
|
24
|
+
Requires-Dist: open-clip-torch>=2.20.0
|
|
25
|
+
Requires-Dist: pyarrow>=17.0.0
|
|
26
|
+
Requires-Dist: python-multipart>=0.0.20
|
|
27
|
+
Requires-Dist: scikit-learn==1.3.2
|
|
28
|
+
Requires-Dist: sqlmodel>=0.0.22
|
|
29
|
+
Requires-Dist: tqdm>=4.65.0
|
|
30
|
+
Requires-Dist: typing-extensions>=4.12.2
|
|
31
|
+
Requires-Dist: uvicorn>=0.32.1
|
|
32
|
+
Requires-Dist: xxhash>=3.5.0
|
|
33
|
+
Provides-Extra: cloud-storage
|
|
34
|
+
Requires-Dist: adlfs>=2023.1.0; extra == 'cloud-storage'
|
|
35
|
+
Requires-Dist: gcsfs>=2023.1.0; extra == 'cloud-storage'
|
|
36
|
+
Requires-Dist: s3fs>=2023.1.0; extra == 'cloud-storage'
|
|
37
|
+
Provides-Extra: lightly-edge
|
|
38
|
+
Requires-Dist: lightly-edge-sdk>=1.0.1b2; extra == 'lightly-edge'
|
|
39
|
+
Requires-Dist: opencv-python; extra == 'lightly-edge'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
<div align="center">
|
|
43
|
+
<p align="center">
|
|
44
|
+
|
|
45
|
+
<!-- prettier-ignore -->
|
|
46
|
+
<img src="https://cdn.prod.website-files.com/62cd5ce03261cba217188442/66dac501a8e9a90495970876_Logo%20dark-short-p-800.png" height="50px">
|
|
47
|
+
|
|
48
|
+
**The open-source tool curating datasets**
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
[](https://pypi.org/project/lightly-studio)
|
|
53
|
+
[](https://pypi.org/project/lightly-studio)
|
|
54
|
+
[](LICENSE)
|
|
55
|
+
|
|
56
|
+
</p>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
# 🚀 Welcome to LightlyStudio!
|
|
60
|
+
|
|
61
|
+
We at **[Lightly](https://lightly.ai)** created **LightlyStudio**, an open-source tool
|
|
62
|
+
designed to supercharge your data curation workflows for computer vision datasets. Explore
|
|
63
|
+
your data, visualize annotations and crops, tag samples, and export curated lists to improve
|
|
64
|
+
your machine learning pipelines. And much more!
|
|
65
|
+
|
|
66
|
+
LightlyStudio runs entirely locally on your machine, keeping your data private. It consists
|
|
67
|
+
of a Python library for indexing your data and a web-based UI for visualization and curation.
|
|
68
|
+
|
|
69
|
+
## ✨ Core Workflow
|
|
70
|
+
|
|
71
|
+
Using LightlyStudio typically involves these steps:
|
|
72
|
+
|
|
73
|
+
1. **Index Your Dataset:** Run a Python script using the `lightly_studio` library to process your local dataset (images and annotations) and save metadata into a local `lightly_studio.db` file.
|
|
74
|
+
2. **Launch the UI:** The script then starts a local web server.
|
|
75
|
+
3. **Explore & Curate:** Use the UI to visualize images, annotations, and object crops. Filter and search your data (experimental text search available). Apply tags to interesting samples (e.g., "mislabeled", "review").
|
|
76
|
+
4. **Export Curated Data:** Export information (like filenames) for your tagged samples from the UI to use downstream.
|
|
77
|
+
5. **Stop the Server:** Close the terminal running the script (Ctrl+C) when done.
|
|
78
|
+
|
|
79
|
+
<p align="center">
|
|
80
|
+
<img alt="LightlyStudio Sample Grid View" src="https://storage.googleapis.com/lightly-public/studio/screenshot_grid_view.jpg" width="70%">
|
|
81
|
+
<br/>
|
|
82
|
+
<em>Visualize your dataset samples with annotations in the grid view.</em>
|
|
83
|
+
</p>
|
|
84
|
+
<p align="center">
|
|
85
|
+
<img alt="LightlyStudio Annotation Crop View" src="https://storage.googleapis.com/lightly-public/studio/screenshot_annotation_view.jpg" width="70%">
|
|
86
|
+
<br/>
|
|
87
|
+
<em>Switch to the annotation view to inspect individual object crops easily.</em>
|
|
88
|
+
</p>
|
|
89
|
+
<p align="center">
|
|
90
|
+
<img alt="LightlyStudio Sample Detail View" src="https://storage.googleapis.com/lightly-public/studio/screenshot_detail_view.jpg" width="70%">
|
|
91
|
+
<br/>
|
|
92
|
+
<em>Inspect individual samples in detail, viewing all annotations and metadata.</em>
|
|
93
|
+
</p>
|
|
94
|
+
|
|
95
|
+
## 🎯 Features
|
|
96
|
+
|
|
97
|
+
- **Local Web GUI:** Explore and curate your dataset in your browser. Works completely
|
|
98
|
+
offline, your data never leaves your machine.
|
|
99
|
+
- **Flexible Input Formats:** Load your image dataset from a folder, or with annotations from
|
|
100
|
+
a number of popular formats like e.g. COCO or YOLO.
|
|
101
|
+
- **Metadata:** Attach your custom metadata to every sample.
|
|
102
|
+
- **Tags:** Mark subsets of your dataset for later use.
|
|
103
|
+
- **Embeddings:** Run similarity search queries on your data.
|
|
104
|
+
- **Selection:** Run advanced selection algorithms to tag a subset of your data.
|
|
105
|
+
|
|
106
|
+
## 💻 Installation
|
|
107
|
+
|
|
108
|
+
Ensure you have **Python 3.8 or higher**. We strongly recommend using a virtual environment.
|
|
109
|
+
|
|
110
|
+
The library is OS-independent and works on Windows, Linux, and macOS.
|
|
111
|
+
|
|
112
|
+
```shell
|
|
113
|
+
# 1. Create and activate a virtual environment (Recommended)
|
|
114
|
+
# On Linux/macOS:
|
|
115
|
+
python3 -m venv venv
|
|
116
|
+
source venv/bin/activate
|
|
117
|
+
|
|
118
|
+
# On Windows:
|
|
119
|
+
python -m venv venv
|
|
120
|
+
.\venv\Scripts\activate
|
|
121
|
+
|
|
122
|
+
# 2. Install LightlyStudio
|
|
123
|
+
pip install lightly-studio
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## **Quickstart**
|
|
127
|
+
|
|
128
|
+
Download example datasets by cloning the example repository:
|
|
129
|
+
|
|
130
|
+
```shell
|
|
131
|
+
git clone https://github.com/lightly-ai/dataset_examples dataset_examples
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### YOLO Object Detection
|
|
135
|
+
|
|
136
|
+
To run an example using a YOLO dataset, create a file named `example_yolo.py` with the
|
|
137
|
+
following contents in the same directory that contains the `dataset_examples/` folder:
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
# example_yolo.py
|
|
141
|
+
|
|
142
|
+
from pathlib import Path
|
|
143
|
+
import lightly_studio as ls
|
|
144
|
+
|
|
145
|
+
# Create a dataset and add the samples from the yolo format
|
|
146
|
+
dataset = ls.Dataset.create()
|
|
147
|
+
dataset.add_samples_from_yolo(
|
|
148
|
+
data_yaml="dataset_examples/road_signs_yolo/data.yaml",
|
|
149
|
+
input_split="test",
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
# Start the UI application on the port 8001.
|
|
153
|
+
ls.start_gui()
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Run the script:
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
python example_yolo.py
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
When you are done, stop the app by pressing Ctrl+C in the terminal.
|
|
163
|
+
|
|
164
|
+
<details>
|
|
165
|
+
<summary>The YOLO format details:</summary>
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
road_signs_yolo/
|
|
169
|
+
├── train/
|
|
170
|
+
│ ├── images/
|
|
171
|
+
│ │ ├── image1.jpg
|
|
172
|
+
│ │ ├── image2.jpg
|
|
173
|
+
│ │ └── ...
|
|
174
|
+
│ └── labels/
|
|
175
|
+
│ ├── image1.txt
|
|
176
|
+
│ ├── image2.txt
|
|
177
|
+
│ └── ...
|
|
178
|
+
├── valid/ (optional)
|
|
179
|
+
│ ├── images/
|
|
180
|
+
│ │ └── ...
|
|
181
|
+
│ └── labels/
|
|
182
|
+
│ └── ...
|
|
183
|
+
└── data.yaml
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Each label file should contain YOLO format annotations (one per line):
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
<class> <x_center> <y_center> <width> <height>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Where coordinates are normalized between 0 and 1.
|
|
193
|
+
|
|
194
|
+
</details>
|
|
195
|
+
|
|
196
|
+
### COCO Instance Segmentation
|
|
197
|
+
|
|
198
|
+
To run an instance segmentation example using a COCO dataset, create a file named
|
|
199
|
+
`example_coco.py` with the following contents in the same directory that contains
|
|
200
|
+
the `dataset_examples/` folder:
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
# example_coco.py
|
|
204
|
+
|
|
205
|
+
from pathlib import Path
|
|
206
|
+
import lightly_studio as ls
|
|
207
|
+
|
|
208
|
+
# Create a dataset and add the samples from the coco format
|
|
209
|
+
dataset = ls.Dataset.create()
|
|
210
|
+
dataset.add_samples_from_coco(
|
|
211
|
+
annotations_json="dataset_examples/coco_subset_128_images/instances_train2017.json",
|
|
212
|
+
images_path="dataset_examples/coco_subset_128_images/images",
|
|
213
|
+
annotation_type=ls.AnnotationType.INSTANCE_SEGMENTATION,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
# Start the UI application on the port 8001.
|
|
217
|
+
ls.start_gui()
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Run the script:
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
python example_coco.py
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
When you are done, stop the app by pressing Ctrl+C in the terminal.
|
|
227
|
+
|
|
228
|
+
<details>
|
|
229
|
+
<summary>The COCO format details:</summary>
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
coco_subset_128_images/
|
|
233
|
+
├── images/
|
|
234
|
+
│ ├── image1.jpg
|
|
235
|
+
│ ├── image2.jpg
|
|
236
|
+
│ └── ...
|
|
237
|
+
└── instances_train2017.json # Single JSON file containing all annotations
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
COCO uses a single JSON file containing all annotations. The format consists of three main components:
|
|
241
|
+
|
|
242
|
+
- Images: Defines metadata for each image in the dataset.
|
|
243
|
+
- Categories: Defines the object classes.
|
|
244
|
+
- Annotations: Defines object instances.
|
|
245
|
+
|
|
246
|
+
</details>
|
|
247
|
+
|
|
248
|
+
## 🔍 How It Works
|
|
249
|
+
|
|
250
|
+
1. Your **Python script** uses the `lightly_studio` **Dataset**.
|
|
251
|
+
2. The `dataset.add_samples_from_<source>` reads your images and annotations, calculates embeddings, and saves metadata to a local **`lightly_studio.db`** file (using DuckDB).
|
|
252
|
+
3. `lightly_studio.start_gui()` starts a **local Backend API** server.
|
|
253
|
+
4. This server reads from `lightly_studio.db` and serves data to the **UI Application** running in your browser (`http://localhost:8001`).
|
|
254
|
+
5. Images are streamed directly from your disk for display in the UI.
|
|
255
|
+
|
|
256
|
+
## 🎯 Python Interface
|
|
257
|
+
|
|
258
|
+
### Dataset
|
|
259
|
+
|
|
260
|
+
#### Load Images From A Folder
|
|
261
|
+
|
|
262
|
+
```py
|
|
263
|
+
import lightly_studio as ls
|
|
264
|
+
|
|
265
|
+
dataset = ls.Dataset.create()
|
|
266
|
+
dataset.add_samples_from_path(path="/path/to/image_dataset")
|
|
267
|
+
|
|
268
|
+
ls.start_gui()
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
#### ☁️ Cloud Storage Support
|
|
272
|
+
|
|
273
|
+
#### Installation with Cloud Storage Support
|
|
274
|
+
|
|
275
|
+
```shell
|
|
276
|
+
pip install lightly-studio[cloud-storage]
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
#### Example: Loading Dataset from Cloud Storage
|
|
280
|
+
|
|
281
|
+
```python
|
|
282
|
+
import lightly_studio as ls
|
|
283
|
+
|
|
284
|
+
dataset = ls.Dataset.create()
|
|
285
|
+
|
|
286
|
+
# Load dataset from S3
|
|
287
|
+
dataset.add_samples_from_path(path="s3://my-bucket/path/to/images/")
|
|
288
|
+
|
|
289
|
+
# You can use glob pattern in the file path
|
|
290
|
+
dataset.add_samples_from_path(path="s3://my-bucket/path/to/images/**/*.jpg") # matches all .jpg files recursively
|
|
291
|
+
|
|
292
|
+
# Load dataset from gcs
|
|
293
|
+
dataset.add_samples_from_path(path="gs://path/to/images/")
|
|
294
|
+
|
|
295
|
+
ls.start_gui()
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
**Note**: Currently, cloud storage support is limited to loading images only. Annotation files (YOLO labels, COCO JSON files, etc.) cannot be loaded directly from cloud storage paths.
|
|
299
|
+
|
|
300
|
+
#### Authentication
|
|
301
|
+
|
|
302
|
+
**Important**: Cloud storage authentication must be configured before running LightlyStudio. The application relies on your existing cloud storage credentials and will not prompt for authentication.
|
|
303
|
+
|
|
304
|
+
#### AWS S3
|
|
305
|
+
|
|
306
|
+
You can use either of the following two options:
|
|
307
|
+
|
|
308
|
+
- **Set environment variables manually**: Set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` (LightlyStudio uses `s3fs` under the hood to connect to S3)
|
|
309
|
+
- **Authenticate using AWS CLI**: Run `aws configure` (this will automatically set the environment variables that LightlyStudio can access)
|
|
310
|
+
|
|
311
|
+
#### Google Cloud Storage
|
|
312
|
+
|
|
313
|
+
You can use either of the following two options:
|
|
314
|
+
|
|
315
|
+
- **Set environment variable manually**: Set `GOOGLE_APPLICATION_CREDENTIALS` pointing to your service account key file (LightlyStudio uses `gcsfs` under the hood to connect to GCS)
|
|
316
|
+
- **Authenticate using gcloud CLI**: Run `gcloud auth application-default login` (this will automatically set the environment variables that LightlyStudio can access)
|
|
317
|
+
|
|
318
|
+
#### Load Images With Annotations
|
|
319
|
+
|
|
320
|
+
The `Dataset` currently supports:
|
|
321
|
+
|
|
322
|
+
- **YOLOv8 Object Detection:** Reads `.yaml` file. Supports bounding boxes.
|
|
323
|
+
- **COCO Object Detection:** Reads `.json` annotations. Supports bounding boxes.
|
|
324
|
+
- **COCO Instance Segmentation:** Reads `.json` annotations. Supports instance masks in RLE (Run-Length Encoding) format.
|
|
325
|
+
|
|
326
|
+
```py
|
|
327
|
+
# Load a dataset in YOLO format
|
|
328
|
+
import lightly_studio as ls
|
|
329
|
+
|
|
330
|
+
dataset = ls.Dataset.create()
|
|
331
|
+
dataset.add_samples_from_yolo(
|
|
332
|
+
data_yaml="my_yolo_dataset/data.yaml",
|
|
333
|
+
input_split="val",
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
ls.start_gui()
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
```py
|
|
340
|
+
# Load an object detection/instance segmentation dataset in COCO format
|
|
341
|
+
import lightly_studio as ls
|
|
342
|
+
|
|
343
|
+
dataset = ls.Dataset.create()
|
|
344
|
+
dataset.add_samples_from_coco(
|
|
345
|
+
annotations_json="my_coco_dataset/detections_train.json",
|
|
346
|
+
images_path="my_coco_dataset/images",
|
|
347
|
+
# If using instance segmentation, uncomment the next line.
|
|
348
|
+
# annotation_type=ls.AnnotationType.INSTANCE_SEGMENTATION,
|
|
349
|
+
)
|
|
350
|
+
|
|
351
|
+
ls.start_gui()
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
#### Load an Existing Dataset
|
|
355
|
+
|
|
356
|
+
It is also possible to load an existing dataset by
|
|
357
|
+
|
|
358
|
+
```py
|
|
359
|
+
import lightly_studio as ls
|
|
360
|
+
|
|
361
|
+
dataset = ls.Dataset.load_or_create()
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
This will load the dataset if it does exist in the `.db` file, else it will create a new dataset.
|
|
365
|
+
|
|
366
|
+
### Samples
|
|
367
|
+
|
|
368
|
+
The dataset consists of samples. Every sample corresponds to an image.
|
|
369
|
+
Dataset samples can be fetched and accessed as follows,
|
|
370
|
+
for a full list of attributes see [sample](src/lightly_studio/core/sample.py).
|
|
371
|
+
|
|
372
|
+
```py
|
|
373
|
+
# Get all dataset samples
|
|
374
|
+
samples = list(dataset)
|
|
375
|
+
|
|
376
|
+
# Access sample attributes
|
|
377
|
+
s = samples[0]
|
|
378
|
+
s.sample_id # Sample ID
|
|
379
|
+
s.file_name # Image file name
|
|
380
|
+
s.file_path_abs # Full image file path
|
|
381
|
+
s.tags # The list of sample tags
|
|
382
|
+
s.metadata["key"] # dict-like access for metadata
|
|
383
|
+
|
|
384
|
+
# Set sample attributes
|
|
385
|
+
s.tags = {"tag1", "tag2"}
|
|
386
|
+
s.metadata["key"] = 123
|
|
387
|
+
|
|
388
|
+
# Adding/removing tags
|
|
389
|
+
s.add_tag("some_tag")
|
|
390
|
+
s.remove_tag("some_tag")
|
|
391
|
+
|
|
392
|
+
...
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Dataset Query
|
|
396
|
+
|
|
397
|
+
You can efficiently fetch filtered dataset samples with a `DatasetQuery()` object. To get a query for a existing `dataset`:
|
|
398
|
+
|
|
399
|
+
```py
|
|
400
|
+
query = dataset.query()
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
By defining the `match`, `order_by`, and `slice` for a query, the intended filtering is set. If one of them is not required, they can be skipped.
|
|
404
|
+
|
|
405
|
+
When the query is used to fetch samples, the order of execution is:
|
|
406
|
+
|
|
407
|
+
1. `match`
|
|
408
|
+
2. `order_by`
|
|
409
|
+
3. `slice`
|
|
410
|
+
|
|
411
|
+
#### Example Query Usage
|
|
412
|
+
|
|
413
|
+
```py
|
|
414
|
+
from lightly_studio.core.dataset_query.boolean_expression import OR
|
|
415
|
+
from lightly_studio.core.dataset_query.order_by import OrderByField
|
|
416
|
+
from lightly_studio.core.dataset_query.sample_field import SampleField
|
|
417
|
+
|
|
418
|
+
query = dataset.match(
|
|
419
|
+
OR(
|
|
420
|
+
SampleField.file_name == "a",
|
|
421
|
+
SampleField.file_name == "b",
|
|
422
|
+
)
|
|
423
|
+
).order_by(
|
|
424
|
+
OrderByField(SampleField.width).desc()
|
|
425
|
+
).slice(offset=10, limit=10)
|
|
426
|
+
|
|
427
|
+
query.add_tag("query_result")
|
|
428
|
+
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
<details>
|
|
432
|
+
<summary>Advanced Example:</summary>
|
|
433
|
+
|
|
434
|
+
```py
|
|
435
|
+
from lightly_studio.core.dataset_query.boolean_expression import AND, OR, NOT
|
|
436
|
+
from lightly_studio.core.dataset_query.order_by import OrderByField
|
|
437
|
+
from lightly_studio.core.dataset_query.sample_field import SampleField
|
|
438
|
+
|
|
439
|
+
query = dataset.match(
|
|
440
|
+
OR(
|
|
441
|
+
SampleField.file_name == "a",
|
|
442
|
+
SampleField.file_name == "b",
|
|
443
|
+
AND(
|
|
444
|
+
SampleField.width > 10,
|
|
445
|
+
SampleField.width < 20,
|
|
446
|
+
NOT(SampleField.tags.contains("dog")),
|
|
447
|
+
),
|
|
448
|
+
)
|
|
449
|
+
).order_by(
|
|
450
|
+
OrderByField(SampleField.width).desc()
|
|
451
|
+
).slice(offset=10, limit=10)
|
|
452
|
+
|
|
453
|
+
query.add_tag("query_result")
|
|
454
|
+
|
|
455
|
+
for sample in query:
|
|
456
|
+
print(sample.tags)
|
|
457
|
+
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
</details>
|
|
461
|
+
|
|
462
|
+
#### Define the Query: `match`
|
|
463
|
+
|
|
464
|
+
The filtering for a query can be set by:
|
|
465
|
+
|
|
466
|
+
```py
|
|
467
|
+
query = query.match(expression)
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
To create an expression for filtering on certain sample fields, the `SampleField.<field_name> <operator> <value>` syntax can be used. Available field names can be seen in [`SampleField`](src/lightly_studio/core/dataset_query/sample_field.py).
|
|
471
|
+
|
|
472
|
+
<details>
|
|
473
|
+
<summary>SampleField Examples:</summary>
|
|
474
|
+
|
|
475
|
+
```py
|
|
476
|
+
from lightly_studio.core.dataset_query.sample_field import SampleField
|
|
477
|
+
|
|
478
|
+
# Ordinal fields: <, <=, >, >=, ==, !=
|
|
479
|
+
|
|
480
|
+
expr = SampleField.height >= 10 # All samples with images that are taller than 9 pixels
|
|
481
|
+
expr = SampleField.width == 10 # All samples with images that are exactly 10 pixels wide
|
|
482
|
+
expr = SampleField.created_at > datetime # All samples created after datetime (actual datetime object)
|
|
483
|
+
|
|
484
|
+
# String fields: ==, !=
|
|
485
|
+
expr = SampleField.file_name == "some" # All samples with "some" as file name
|
|
486
|
+
expr = SampleField.file_path_abs != "other" # All samples that are not having "other" as file_path
|
|
487
|
+
|
|
488
|
+
# Tags: contains()
|
|
489
|
+
expr = SampleField.tags.contains("dog") # All samples that contain the tag "dog"
|
|
490
|
+
|
|
491
|
+
# Assign any of the previous expressions to a query:
|
|
492
|
+
query = query.match(expr)
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
</details>
|
|
496
|
+
|
|
497
|
+
The filtering on individual fields can flexibly be combined to create more complex match expression. For this, the boolean operators [`AND`](src/lightly_studio/core/dataset_query/boolean_expression.py), [`OR`](src/lightly_studio/core/dataset_query/boolean_expression.py), and [`NOT`](src/lightly_studio/core/dataset_query/boolean_expression.py) are available. Boolean operators can arbitrarily be nested.
|
|
498
|
+
|
|
499
|
+
<details>
|
|
500
|
+
<summary>Boolean Examples:</summary>
|
|
501
|
+
|
|
502
|
+
```py
|
|
503
|
+
from lightly_studio.core.dataset_query.boolean_expression import AND, OR, NOT
|
|
504
|
+
from lightly_studio.core.dataset_query.sample_field import SampleField
|
|
505
|
+
|
|
506
|
+
# All samples with images that are between 10 and 20 pixels wide
|
|
507
|
+
expr = AND(
|
|
508
|
+
SampleField.width > 10,
|
|
509
|
+
SampleField.width < 20
|
|
510
|
+
)
|
|
511
|
+
|
|
512
|
+
# All samples with file names that are either "a" or "b"
|
|
513
|
+
expr = OR(
|
|
514
|
+
SampleField.file_name == "a",
|
|
515
|
+
SampleField.file_name == "b"
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
# All samples which do not contain a tag "dog"
|
|
519
|
+
expr = NOT(SampleField.tags.contains("dog"))
|
|
520
|
+
|
|
521
|
+
# All samples for a nested expression
|
|
522
|
+
expr = OR(
|
|
523
|
+
SampleField.file_name == "a",
|
|
524
|
+
SampleField.file_name == "b",
|
|
525
|
+
AND(
|
|
526
|
+
SampleField.width > 10,
|
|
527
|
+
SampleField.width < 20,
|
|
528
|
+
NOT(
|
|
529
|
+
SampleField.tags.contains("dog")
|
|
530
|
+
),
|
|
531
|
+
),
|
|
532
|
+
)
|
|
533
|
+
|
|
534
|
+
# Assign any of the previous expressions to a query:
|
|
535
|
+
query = query.match(expr)
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
</details>
|
|
539
|
+
|
|
540
|
+
#### Define the Query: `order_by`
|
|
541
|
+
|
|
542
|
+
Setting the sorting of a query can done by
|
|
543
|
+
|
|
544
|
+
```py
|
|
545
|
+
query = query.order_by(expression)
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
The order expression can be defined by `OrderByField(SampleField.<field_name>).<order_direction>()`.
|
|
549
|
+
|
|
550
|
+
<details>
|
|
551
|
+
<summary>OrderByField Examples:</summary>
|
|
552
|
+
|
|
553
|
+
```py
|
|
554
|
+
from lightly_studio.core.dataset_query.order_by import OrderByField
|
|
555
|
+
from lightly_studio.core.dataset_query.sample_field import SampleField
|
|
556
|
+
|
|
557
|
+
# Sort the query by the width of the image in ascending order
|
|
558
|
+
expr = OrderByField(SampleField.width)
|
|
559
|
+
expr = OrderByField(SampleField.width).asc()
|
|
560
|
+
|
|
561
|
+
# Sort the query by the height of the image in descending order
|
|
562
|
+
expr = OrderByField(SampleField.file_name).desc()
|
|
563
|
+
|
|
564
|
+
# Assign any of the previous expressions to a query:
|
|
565
|
+
query = query.order_by(expr)
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
</details>
|
|
569
|
+
|
|
570
|
+
#### Define the Query: `slice`
|
|
571
|
+
|
|
572
|
+
Setting the slicing of a query can done by:
|
|
573
|
+
|
|
574
|
+
```py
|
|
575
|
+
query = query.slice(offset, limit)
|
|
576
|
+
# OR
|
|
577
|
+
query = query[offset:stop]
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
Both are different syntax for the same operation.
|
|
581
|
+
|
|
582
|
+
<details>
|
|
583
|
+
<summary>Slice Examples:</summary>
|
|
584
|
+
|
|
585
|
+
```py
|
|
586
|
+
# Slice 2:5
|
|
587
|
+
query = query.slice(offset=2, limit=3)
|
|
588
|
+
query = query[2:5]
|
|
589
|
+
|
|
590
|
+
# Slice :5
|
|
591
|
+
query = query.slice(limit=5)
|
|
592
|
+
query = query[:5]
|
|
593
|
+
|
|
594
|
+
# Slice 5:
|
|
595
|
+
query = query.slice(offset=5)
|
|
596
|
+
query = query[5:]
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
</details>
|
|
600
|
+
|
|
601
|
+
#### Access the Samples
|
|
602
|
+
|
|
603
|
+
To access the filtered samples two possibilities are available: iterating over the query object or calling the `to_list()` method.
|
|
604
|
+
|
|
605
|
+
**Iterating over the query:**
|
|
606
|
+
|
|
607
|
+
```py
|
|
608
|
+
query = dataset.query().match(match_expression).order_by(order_by_expression).slice(offset,limit)
|
|
609
|
+
|
|
610
|
+
samples = []
|
|
611
|
+
for sample in query:
|
|
612
|
+
samples.append(sample)
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
**Get all samples as list:**
|
|
616
|
+
|
|
617
|
+
```py
|
|
618
|
+
query = dataset.query().match(match_expression).order_by(order_by_expression).slice(offset,limit)
|
|
619
|
+
|
|
620
|
+
samples = query.to_list()
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
In some use cases, one might want to assign a tag to the samples that are the result of a query:
|
|
624
|
+
|
|
625
|
+
```py
|
|
626
|
+
query.add_tag("tag_name")
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
#### Export Samples
|
|
630
|
+
|
|
631
|
+
Currently, exporting to the COCO object detection format is supported. The following example shows how to export the samples in the query to a COCO JSON file:
|
|
632
|
+
|
|
633
|
+
```py
|
|
634
|
+
from pathlib import Path
|
|
635
|
+
|
|
636
|
+
query.export().to_coco_object_detections(Path("coco_export.json"))
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
### Examples
|
|
640
|
+
|
|
641
|
+
#### Add Custom Metadata
|
|
642
|
+
|
|
643
|
+
Attach values to custom fields for every sample.
|
|
644
|
+
|
|
645
|
+
```py
|
|
646
|
+
import lightly_studio as ls
|
|
647
|
+
|
|
648
|
+
# Load your dataset
|
|
649
|
+
dataset = ls.Dataset.create()
|
|
650
|
+
dataset.add_samples_from_path(path="/path/to/image_dataset")
|
|
651
|
+
|
|
652
|
+
# Attach metadata
|
|
653
|
+
for sample in dataset:
|
|
654
|
+
sample.metadata["my_metadata"] = f"Example metadata field for {sample.file_name}"
|
|
655
|
+
sample.metadata["my_dict"] = {"my_int_key": 10, "my_bool_key": True}
|
|
656
|
+
|
|
657
|
+
# View metadata in GUI
|
|
658
|
+
ls.start_gui()
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
#### Tags
|
|
662
|
+
|
|
663
|
+
You can easily mark subsets of your data with tags.
|
|
664
|
+
|
|
665
|
+
```py
|
|
666
|
+
import lightly_studio as ls
|
|
667
|
+
|
|
668
|
+
# Load your dataset
|
|
669
|
+
dataset = ls.Dataset.create()
|
|
670
|
+
dataset.add_samples_from_path(path="/path/to/image_dataset")
|
|
671
|
+
|
|
672
|
+
# Tag the first 10 samples:
|
|
673
|
+
query = dataset.query()[:10]
|
|
674
|
+
query.add_tag("some_tag")
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
Find existing tags and tagged samples as follows.
|
|
678
|
+
|
|
679
|
+
```py
|
|
680
|
+
import lightly_studio as ls
|
|
681
|
+
|
|
682
|
+
# Load your dataset
|
|
683
|
+
dataset = ls.Dataset.create()
|
|
684
|
+
dataset.add_samples_from_path(path="/path/to/image_dataset")
|
|
685
|
+
|
|
686
|
+
# Get all samples that contain the tag "dog"
|
|
687
|
+
query = dataset.query().match(SampleField.tags.contains("dog"))
|
|
688
|
+
samples = query.to_list()
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
### Selection
|
|
692
|
+
|
|
693
|
+
LightlyStudio offers as a premium feature advanced methods for subselecting dataset
|
|
694
|
+
samples.
|
|
695
|
+
|
|
696
|
+
**Prerequisites:** The selection functionality requires a valid LightlyStudio license key.
|
|
697
|
+
Set the `LIGHTLY_STUDIO_LICENSE_KEY` environment variable before using selection features:
|
|
698
|
+
|
|
699
|
+
```bash
|
|
700
|
+
export LIGHTLY_STUDIO_LICENSE_KEY="license_key_here"
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
Alternatively, set it inside your Python script:
|
|
704
|
+
|
|
705
|
+
```py
|
|
706
|
+
import os
|
|
707
|
+
os.environ["LIGHTLY_STUDIO_LICENSE_KEY"] = "license_key_here"
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
#### Diversity Selection
|
|
711
|
+
|
|
712
|
+
Diversity selection can be configured directly from a `DatasetQuery`. The example below showcases a simple case of selecting diverse samples.
|
|
713
|
+
|
|
714
|
+
```py
|
|
715
|
+
import lightly_studio as ls
|
|
716
|
+
|
|
717
|
+
# Load your dataset
|
|
718
|
+
dataset = ls.Dataset.load_or_create()
|
|
719
|
+
dataset.add_samples_from_path(path="/path/to/image_dataset")
|
|
720
|
+
|
|
721
|
+
# Select a diverse subset of 10 samples.
|
|
722
|
+
dataset.query().selection().diverse(
|
|
723
|
+
n_samples_to_select=10,
|
|
724
|
+
selection_result_tag_name="diverse_selection",
|
|
725
|
+
)
|
|
726
|
+
|
|
727
|
+
ls.start_gui()
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
#### Metadata Weighting Selection
|
|
731
|
+
|
|
732
|
+
You can select samples based on the values of a metadata field. The example below showcases a simple case of selecting samples with the highest metadata value.
|
|
733
|
+
|
|
734
|
+
```py
|
|
735
|
+
import lightly_studio as ls
|
|
736
|
+
|
|
737
|
+
# Load your dataset
|
|
738
|
+
dataset = ls.Dataset.load_or_create()
|
|
739
|
+
dataset.add_samples_from_path(path="/path/to/image_dataset")
|
|
740
|
+
# Compute and store 'typicality' metadata.
|
|
741
|
+
dataset.compute_typicality_metadata(metadata_name="typicality")
|
|
742
|
+
|
|
743
|
+
# Select the 5 samples with the highest 'typicality' scores.
|
|
744
|
+
dataset.query().selection().metadata_weighting(
|
|
745
|
+
n_samples_to_select=5,
|
|
746
|
+
selection_result_tag_name="metadata_weighting_selection",
|
|
747
|
+
metadata_key="typicality",
|
|
748
|
+
)
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
#### Selection Based on Multiple Strategies
|
|
752
|
+
|
|
753
|
+
You can configure multiple strategies, the selection takes into account all of them at the same time, weighted by the `strength` parameter.
|
|
754
|
+
|
|
755
|
+
```py
|
|
756
|
+
import lightly_studio as ls
|
|
757
|
+
from lightly_studio.selection.selection_config import (
|
|
758
|
+
MetadataWeightingStrategy,
|
|
759
|
+
EmbeddingDiversityStrategy,
|
|
760
|
+
)
|
|
761
|
+
|
|
762
|
+
# Load your dataset
|
|
763
|
+
dataset = ls.Dataset.load_or_create()
|
|
764
|
+
dataset.add_samples_from_path(path="/path/to/image_dataset")
|
|
765
|
+
# Compute typicality and store it as `typicality` metadata
|
|
766
|
+
dataset.compute_typicality_metadata(metadata_name="typicality")
|
|
767
|
+
|
|
768
|
+
# Select 10 samples by combining typicality and diversity, diversity having double the strength.
|
|
769
|
+
dataset.query().selection().multi_strategies(
|
|
770
|
+
n_samples_to_select=10,
|
|
771
|
+
selection_result_tag_name="multi_strategy_selection",
|
|
772
|
+
selection_strategies=[
|
|
773
|
+
MetadataWeightingStrategy(metadata_key="typicality", strength=1.0),
|
|
774
|
+
EmbeddingDiversityStrategy(embedding_model_name="my_model_name", strength=2.0),
|
|
775
|
+
],
|
|
776
|
+
)
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
#### Exporting Selected Samples
|
|
780
|
+
|
|
781
|
+
The selected sample paths can be exported via the GUI, or by a script:
|
|
782
|
+
|
|
783
|
+
```py
|
|
784
|
+
import lightly_studio as ls
|
|
785
|
+
from lightly_studio.core.dataset_query.sample_field import SampleField
|
|
786
|
+
|
|
787
|
+
dataset = ls.Dataset.load("my-dataset")
|
|
788
|
+
selected_samples = (
|
|
789
|
+
dataset.match(SampleField.tags.contains("diverse_selection")).to_list()
|
|
790
|
+
)
|
|
791
|
+
|
|
792
|
+
with open("export.txt", "w") as f:
|
|
793
|
+
for sample in selected_samples:
|
|
794
|
+
f.write(f"{sample.file_path_abs}\n")
|
|
795
|
+
```
|
|
796
|
+
|
|
797
|
+
## 📚 **FAQ**
|
|
798
|
+
|
|
799
|
+
### Are the datasets persistent?
|
|
800
|
+
|
|
801
|
+
Yes, the information about datasets is persistent and stored in the db file. You can see it after the dataset is processed.
|
|
802
|
+
If you rerun the loader it will create a new dataset representing the same dataset, keeping the previous dataset information untouched.
|
|
803
|
+
|
|
804
|
+
### Can I change the database path?
|
|
805
|
+
|
|
806
|
+
Not yet. The database is stored in the working directory by default.
|
|
807
|
+
|
|
808
|
+
### Can I launch in another Python script or do I have to do it in the same script?
|
|
809
|
+
|
|
810
|
+
It is possible to use only one script at the same time because we lock the db file for the duration of the script.
|
|
811
|
+
|
|
812
|
+
### Can I change the API backend port?
|
|
813
|
+
|
|
814
|
+
Yes. To change the port set the LIGHTLY_STUDIO_PORT variable to your preffered value. If at runtime the port is unavailable it will try to set it to a random value.
|