lightly-studio 0.3.2__py3-none-any.whl → 0.3.4__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.
Potentially problematic release.
This version of lightly-studio might be problematic. Click here for more details.
- lightly_studio/__init__.py +1 -1
- lightly_studio/api/app.py +8 -4
- lightly_studio/api/db_tables.py +0 -3
- lightly_studio/api/routes/api/annotation.py +26 -0
- lightly_studio/api/routes/api/annotations/__init__.py +7 -0
- lightly_studio/api/routes/api/annotations/create_annotation.py +52 -0
- lightly_studio/api/routes/api/caption.py +30 -0
- lightly_studio/api/routes/api/dataset.py +3 -5
- lightly_studio/api/routes/api/embeddings2d.py +136 -0
- lightly_studio/api/routes/api/export.py +73 -0
- lightly_studio/api/routes/api/metadata.py +57 -1
- lightly_studio/api/routes/api/selection.py +87 -0
- lightly_studio/core/add_samples.py +138 -9
- lightly_studio/core/dataset.py +174 -63
- lightly_studio/core/dataset_query/dataset_query.py +5 -0
- lightly_studio/dataset/env.py +4 -0
- lightly_studio/dataset/file_utils.py +13 -2
- lightly_studio/dataset/loader.py +2 -62
- lightly_studio/dataset/mobileclip_embedding_generator.py +3 -2
- lightly_studio/db_manager.py +10 -4
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.B3oFNb6O.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/2.CkOblLn7.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/Samples.CIbricz7.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.7Ma7YdVg.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/{useFeatureFlags.CV-KWLNP.css → _layout.CefECEWA.css} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/transform.2jKMtOWG.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/-DXuGN29.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{Ccq4ZD0B.js → B7302SU7.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BeWf8-vJ.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Bqz7dyEC.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/C1FmrZbK.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{DRZO-E-T.js → CSCQddQS.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CZGpyrcA.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CfQ4mGwl.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CiaNZCBa.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cqo0Vpvt.js +417 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cy4fgWTG.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D5w4xp5l.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DD63uD-T.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DQ8aZ1o-.js +3 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{Df3aMO5B.js → DSxvnAMh.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D_JuJOO3.js +20 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D_ynJAfY.js +2 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Dafy4oEQ.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{BqBqV92V.js → Dj4O-5se.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DmjAI-UV.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Dug7Bq1S.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Dv5BSBQG.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DzBTnFhV.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DzX_yyqb.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Frwd2CjB.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/H4l0JFh9.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/H60ATh8g.js +2 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/qIv1kPyv.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/sLqs1uaK.js +20 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/u-it74zV.js +96 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/app.BPc0HQPq.js +2 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.SNvc2nrm.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/0.5jT7P06o.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/1.Cdy-7S5q.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/10.C_uoESTX.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/12.DcO8wIAc.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/2.BIldfkxL.js +1012 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{3.w9g4AcAx.js → 3.BC9z_TWM.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{4.BBI8KwnD.js → 4.D8X_Ch5n.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.CAXhxJu6.js +39 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{6.CrbkRPam.js → 6.DRA5Ru_2.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/7.WVBsruHQ.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.BuKUrCEN.js +20 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/9.CUIn1yCR.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/workers/clustering.worker-DKqeLtG0.js +2 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/workers/search.worker-vNSty3B0.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/version.json +1 -1
- lightly_studio/dist_lightly_studio_view_app/index.html +15 -14
- lightly_studio/examples/example.py +4 -0
- lightly_studio/examples/example_coco.py +4 -0
- lightly_studio/examples/example_coco_caption.py +24 -0
- lightly_studio/examples/example_metadata.py +4 -1
- lightly_studio/examples/example_selection.py +4 -0
- lightly_studio/examples/example_split_work.py +4 -0
- lightly_studio/examples/example_yolo.py +4 -0
- lightly_studio/export/export_dataset.py +73 -0
- lightly_studio/export/lightly_studio_label_input.py +120 -0
- lightly_studio/few_shot_classifier/classifier_manager.py +5 -26
- lightly_studio/metadata/compute_typicality.py +67 -0
- lightly_studio/models/annotation/annotation_base.py +11 -12
- lightly_studio/models/caption.py +73 -0
- lightly_studio/models/dataset.py +1 -2
- lightly_studio/models/metadata.py +1 -1
- lightly_studio/models/sample.py +2 -2
- lightly_studio/resolvers/annotation_label_resolver/__init__.py +2 -1
- lightly_studio/resolvers/annotation_label_resolver/get_all.py +15 -0
- lightly_studio/resolvers/annotation_resolver/__init__.py +2 -3
- lightly_studio/resolvers/annotation_resolver/create_many.py +3 -3
- lightly_studio/resolvers/annotation_resolver/delete_annotation.py +1 -1
- lightly_studio/resolvers/annotation_resolver/delete_annotations.py +7 -3
- lightly_studio/resolvers/annotation_resolver/get_by_id.py +19 -1
- lightly_studio/resolvers/annotation_resolver/update_annotation_label.py +0 -1
- lightly_studio/resolvers/annotations/annotations_filter.py +1 -11
- lightly_studio/resolvers/caption_resolver.py +80 -0
- lightly_studio/resolvers/dataset_resolver.py +4 -7
- lightly_studio/resolvers/metadata_resolver/__init__.py +2 -2
- lightly_studio/resolvers/metadata_resolver/sample/__init__.py +3 -3
- lightly_studio/resolvers/metadata_resolver/sample/bulk_update_metadata.py +46 -0
- lightly_studio/resolvers/samples_filter.py +18 -10
- lightly_studio/selection/mundig.py +7 -10
- lightly_studio/selection/selection_config.py +4 -1
- lightly_studio/services/annotations_service/__init__.py +8 -0
- lightly_studio/services/annotations_service/create_annotation.py +63 -0
- lightly_studio/services/annotations_service/delete_annotation.py +22 -0
- lightly_studio/type_definitions.py +2 -0
- {lightly_studio-0.3.2.dist-info → lightly_studio-0.3.4.dist-info}/METADATA +231 -41
- {lightly_studio-0.3.2.dist-info → lightly_studio-0.3.4.dist-info}/RECORD +114 -104
- lightly_studio/api/routes/api/annotation_task.py +0 -37
- lightly_studio/api/routes/api/metrics.py +0 -76
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.DenzbfeK.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/SelectableSvgGroup.BBm0IWdq.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/SelectableSvgGroup.BNTuXSAe.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.T-zjSUd3.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/2O287xak.js +0 -3
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/7YNGEs1C.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BBoGk9hq.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BRnH9v23.js +0 -92
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Bg1Y5eUZ.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/C0JiMuYn.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/C98Hk3r5.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CG0dMCJi.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cpy-nab_.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Crk-jcvV.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cs31G8Qn.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CsKrY2zA.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cur71c3O.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CzgC3GFB.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D8GZDMNN.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DFRh-Spp.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DcGCxgpH.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DkR_EZ_B.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DqUGznj_.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/H7C68rOM.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/KpAtIldw.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/M1Q1F7bw.js +0 -4
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/OH7-C_mc.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/gLNdjSzu.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/i0ZZ4z06.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/app.BI-EA5gL.js +0 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.CcsRl3cZ.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/0.BbO4Zc3r.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/1._I9GR805.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/10.J2RBFrSr.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/12.Cmqj25a-.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/2.C45iKJHA.js +0 -6
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.huHuxdiF.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/7.FomEdhD6.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.Cb_ADSLk.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/9.CajIG5ce.js +0 -1
- lightly_studio/metrics/__init__.py +0 -0
- lightly_studio/metrics/detection/__init__.py +0 -0
- lightly_studio/metrics/detection/map.py +0 -268
- lightly_studio/models/annotation_task.py +0 -28
- lightly_studio/resolvers/annotation_resolver/create.py +0 -19
- lightly_studio/resolvers/annotation_task_resolver.py +0 -31
- lightly_studio/resolvers/metadata_resolver/sample/bulk_set_metadata.py +0 -48
- {lightly_studio-0.3.2.dist-info → lightly_studio-0.3.4.dist-info}/WHEEL +0 -0
lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{3.w9g4AcAx.js → 3.BC9z_TWM.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a}from"../chunks/
|
|
1
|
+
import{u as a}from"../chunks/Cy4fgWTG.js";import{L as d}from"../chunks/Dv5BSBQG.js";const s=async({parent:t,params:{dataset_id:e}})=>{const{globalStorage:o}=await t(),{tagsSelected:n}=a({dataset_id:e,kind:["annotation"]});return{annotationsSelectedTagsIds:n,annotationsSelectedAnnotationLabelsIds:o.selectedAnnotationFilterIds}},r=Object.freeze(Object.defineProperty({__proto__:null,load:s},Symbol.toStringTag,{value:"Module"}));export{d as component,r as universal};
|
lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{4.BBI8KwnD.js → 4.D8X_Ch5n.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a}from"../chunks/
|
|
1
|
+
import{u as a}from"../chunks/Bqz7dyEC.js";import{u as l}from"../chunks/Cy4fgWTG.js";import{u as m}from"../chunks/qIv1kPyv.js";import{L as b}from"../chunks/Dv5BSBQG.js";const r=async({params:{dataset_id:e}})=>{const{selectedAnnotationFilterIds:s,textEmbedding:o}=m(),{tagsSelected:t}=l({dataset_id:e,kind:["sample"]}),{dimensionsValues:n}=a();return{samplesSelectedTagsIds:t,samplesDimensions:n,samplesTextEmbedding:o,samplesSelectedAnnotationLabelsIds:s}},c=Object.freeze(Object.defineProperty({__proto__:null,load:r},Symbol.toStringTag,{value:"Module"}));export{b as component,c as universal};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{p as mt,f as _,n as re,a as gt,au as Qt,g as t,b as r,s as h,c as $,r as I,t as ut,m as vt,u as De,Y as s,ak as R,aa as te,$ as ee}from"../chunks/Frwd2CjB.js";import{c as J,a as c,f as Q,t as ae,b as $t}from"../chunks/CiaNZCBa.js";import{s as It}from"../chunks/DzX_yyqb.js";import{i as Y,s as j,a as zt}from"../chunks/-DXuGN29.js";import{p as yt}from"../chunks/DSxvnAMh.js";import{I as le,o as He,p as Fe,q as ze,r as At,f as Ne,s as Xe,_ as Ye,t as Ue,C as Ze,v as Ke,S as Oe,n as je,w as Ge,x as Ve}from"../chunks/Cqo0Vpvt.js";import{u as ie}from"../chunks/qIv1kPyv.js";import{u as de,k as We,t as ct,s as H,e as qe,b as Je}from"../chunks/D_ynJAfY.js";import"../chunks/Bqz7dyEC.js";import"../chunks/D5w4xp5l.js";import"../chunks/69_IOA4Y.js";import{a as Qe,g as ta}from"../chunks/DQ8aZ1o-.js";import{e as ne}from"../chunks/Dug7Bq1S.js";import{s as ce,r as ue,p as ea,b as oe}from"../chunks/Dafy4oEQ.js";import{S as aa}from"../chunks/CZGpyrcA.js";import{r as St}from"../chunks/CfQ4mGwl.js";import{S as na,s as oa,d as sa,R as ra}from"../chunks/DmjAI-UV.js";import{s as se}from"../chunks/H60ATh8g.js";import{B as la,a as ia,b as wt,c as Ht,H as da,d as Ft,D as ca,e as ua,u as me,Z as ma,g as ga}from"../chunks/u-it74zV.js";import{b as ha,d as va,e as fa,r as pa}from"../chunks/DD63uD-T.js";function _a(u,e){mt(e,!0);/**
|
|
2
|
+
* @license @lucide/svelte v0.482.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* ISC License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
7
|
+
*
|
|
8
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
10
|
+
* copyright notice and this permission notice appear in all copies.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
13
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
14
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
15
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
16
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
17
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
18
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
+
*
|
|
20
|
+
*/let m=ue(e,["$$slots","$$events","$$legacy"]);const l=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["circle",{cx:"10",cy:"12",r:"2"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22"}]];le(u,ce({name:"file-image"},()=>m,{get iconNode(){return l},children:(n,i)=>{var d=J(),p=_(d);It(p,()=>e.children??re),c(n,d)},$$slots:{default:!0}})),gt()}function ba(u,e){mt(e,!0);/**
|
|
21
|
+
* @license @lucide/svelte v0.482.0 - ISC
|
|
22
|
+
*
|
|
23
|
+
* ISC License
|
|
24
|
+
*
|
|
25
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
26
|
+
*
|
|
27
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
28
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
29
|
+
* copyright notice and this permission notice appear in all copies.
|
|
30
|
+
*
|
|
31
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
32
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
33
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
34
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
35
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
36
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
37
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
38
|
+
*
|
|
39
|
+
*/let m=ue(e,["$$slots","$$events","$$legacy"]);const l=[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18"}],["circle",{cx:"12",cy:"8",r:"2"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2"}]];le(u,ce({name:"images"},()=>m,{get iconNode(){return l},children:(n,i)=>{var d=J(),p=_(d);It(p,()=>e.children??re),c(n,d)},$$slots:{default:!0}})),gt()}var xa=Q('<!> <span class="hidden sm:inline">Home</span>',1),wa=Q('<!> <span class="max-w-[150px] truncate"> </span>',1),ya=Q('<!> <span class="hidden sm:inline">Samples</span>',1),Sa=Q('<!> <span class="max-w-[200px] truncate"><!></span>',1),$a=Q("<!> <!> <!> <!> <!> <!> <!>",1);function Ia(u,e){mt(e,!0);const m=()=>j(i,"$samplesTotalCount",l),[l,n]=zt(),{samplesTotalCount:i}=ie();la(u,{class:"mb-2","data-testid":"sample-details-breadcrumb",children:(d,p)=>{ia(d,{children:(tt,ot)=>{var F=$a(),w=_(F);wt(w,{children:(A,G)=>{{let g=r(()=>St.toHome());Ht(A,{get href(){return t(g)},class:"flex items-center gap-2",children:(P,T)=>{var b=xa(),y=_(b);da(y,{class:"h-4 w-4"}),Qt(2),c(P,b)},$$slots:{default:!0}})}},$$slots:{default:!0}});var z=h(w,2);Ft(z,{});var C=h(z,2);wt(C,{children:(A,G)=>{{let g=r(()=>St.toSamples(e.dataset.dataset_id));Ht(A,{get href(){return t(g)},class:"flex items-center gap-2",children:(P,T)=>{var b=wa(),y=_(b);ca(y,{class:"h-4 w-4"});var M=h(y,2),et=$(M,!0);I(M),ut(()=>se(et,e.dataset.name)),c(P,b)},$$slots:{default:!0}})}},$$slots:{default:!0}});var U=h(C,2);Ft(U,{});var N=h(U,2);wt(N,{children:(A,G)=>{{let g=r(()=>St.toSamples(e.dataset.dataset_id));Ht(A,{get href(){return t(g)},class:"flex items-center gap-2",children:(P,T)=>{var b=ya(),y=_(b);ba(y,{class:"h-4 w-4"}),Qt(2),c(P,b)},$$slots:{default:!0}})}},$$slots:{default:!0}});var st=h(N,2);Ft(st,{});var rt=h(st,2);wt(rt,{children:(A,G)=>{ua(A,{class:"flex items-center gap-2",children:(g,P)=>{var T=Sa(),b=_(T);_a(b,{class:"h-4 w-4"});var y=h(b,2),M=$(y);{var et=V=>{var lt=ae();ut(()=>se(lt,`Sample ${e.sampleIndex+1} of ${m()??""}`)),c(V,lt)},Pt=V=>{var lt=ae("Sample");c(V,lt)};Y(M,V=>{e.sampleIndex!==void 0?V(et):V(Pt,!1)})}I(y),c(g,T)},$$slots:{default:!0}})},$$slots:{default:!0}}),c(tt,F)},$$slots:{default:!0}})},$$slots:{default:!0}}),gt(),n()}function Aa(u,e){mt(e,!0);const m=()=>j(t(F),"$annotationResp",i),l=()=>j(t(U),"$sample",i),n=()=>j(tt,"$showAnnotationTextLabelsStore",i),[i,d]=zt(),p=ea(e,"isResizable",3,!1),{showAnnotationTextLabelsStore:tt}=de(),ot=r(()=>ze({datasetId:e.datasetId,annotationId:e.annotationId})),F=r(()=>t(ot).annotation),w=r(()=>t(ot).updateAnnotation);let z=r(()=>m().data);const C=r(()=>me({sampleId:e.sampleId,datasetId:e.datasetId})),U=r(()=>t(C).sample);let N=r(()=>m().data?He(m().data):void 0);const st=g=>{(async()=>{try{await t(w)({annotation_id:e.annotationId,dataset_id:e.datasetId,bounding_box:g})}catch(T){console.error("Failed to update annotation:",T.message)}})()};var rt=J(),A=_(rt);{var G=g=>{var P=J(),T=_(P);We(T,()=>t(N),b=>{Fe(b,{get groupId(){return t(z).annotation_id},get onSelect(){return e.toggleAnnotationSelection},get box(){return t(N)},get isSelected(){return e.isSelected},children:(y,M)=>{{let et=r(()=>({x:0,y:0,width:l().data.width,height:l().data.height}));na(y,{get annotation(){return t(z)},get showLabel(){return n()},get imageWidth(){return l().data.width},get constraintBox(){return t(et)},get isResizable(){return p()},onBoundingBoxChanged:st})}},$$slots:{default:!0}})}),c(g,P)};Y(A,g=>{t(z)&&l().data&&t(N)&&g(G)})}c(u,rt),gt(),d()}const Pa=({datasetId:u})=>{const e=At(ha());return e.subscribe(()=>{}),{createAnnotation:l=>new Promise((n,i)=>{vt(e).mutate({path:{dataset_id:u},body:l},{onSuccess:d=>{n(d)},onError:d=>{i(d)}})})}},Ma=()=>{const u=At(va());return u.subscribe(()=>{}),{createLabel:m=>new Promise((l,n)=>{vt(u).mutate({body:m},{onSuccess:i=>{l(i)},onError:i=>{n(i)}})})}},ka=({datasetId:u})=>{const e=At(fa());return e.subscribe(()=>{}),{deleteAnnotation:l=>new Promise((n,i)=>{vt(e).mutate({path:{dataset_id:u,annotation_id:l}},{onSuccess:()=>{n()},onError:d=>{i(d)}})})}},Ba=({datasetId:u})=>{const e=At(pa());return e.subscribe(()=>{}),{removeTagFromSample:(l,n)=>new Promise((i,d)=>{vt(e).mutate({path:{dataset_id:u,sample_id:l,tag_id:n}},{onSuccess:()=>i(),onError:p=>d(p)})})}};var Ea=$t('<line x1="0" stroke-width="1" vector-effect="non-scaling-stroke" stroke-dasharray="5,5" opacity="0.6"></line><line y1="0" vector-effect="non-scaling-stroke" stroke-width="1" stroke-dasharray="5,5" opacity="0.6"></line>',1),Ra=$t('<rect class="select-none" fill="transparent" role="button" style="outline: 0;cursor: crosshair;" tabindex="0"></rect>'),Ca=$t("<g><!><!><!></g><!>",1),Ta=$t("<image></image><!>",1),La=Q('<div class="h-full w-full overflow-hidden"><div class="sample relative h-full w-full"><div class="absolute right-4 top-2 z-30"><!></div> <!> <!></div></div>'),Da=Q('<div class="flex h-full w-full flex-col space-y-4"><div class="flex w-full items-center"><!></div> <!> <div class="flex min-h-0 flex-1 gap-4"><div class="flex-1"><!></div> <div class="relative w-[375px]"><!></div></div></div>');function Ha(u,e){mt(e,!0);const m=()=>j(T,"$labels",p),l=()=>j(y,"$isEditingMode",p),n=()=>j(t(G),"$sample",p),i=()=>j(ot,"$selectedSampleIds",p),d=()=>j(z,"$isHidden",p),[p,tt]=zt(),{selectedSampleIds:ot,toggleSampleSelection:F}=ie(),w=e.dataset.dataset_id,{isHidden:z,handleKeyEvent:C}=Ne(),{settingsStore:U}=de(),{deleteAnnotation:N}=ka({datasetId:w}),{removeTagFromSample:st}=Ba({datasetId:w}),rt=()=>{ta(St.toSamples(w))},A=r(()=>me({sampleId:e.sampleId,datasetId:w})),G=r(()=>t(A).sample),g=r(()=>t(A).refetch),{createAnnotation:P}=Pa({datasetId:w}),T=Xe(),{createLabel:b}=Ma(),{isEditingMode:y}=yt.data.globalStorage;let M=R(!1);const et=async({x:a,y:o,width:k,height:L,labelName:v})=>{if(!m().data)return;let B=m().data.find(x=>x.annotation_label_name===v);B||(B=await b({annotation_label_name:v}));try{const x=await P({sample_id:e.sampleId,annotation_type:"object_detection",x:Math.round(a),y:Math.round(o),width:Math.round(k),height:Math.round(L),annotation_label_id:B.annotation_label_id});return t(g)(),s(Z,x.annotation_id,!0),ct.success("Annotation created successfully"),x}catch(x){ct.error("Failed to create annotation. Please try again."),console.error("Error creating annotation:",x);return}},Pt=a=>{switch(a.key){case vt(U).key_go_back:rt();break;case" ":a.preventDefault(),a.stopPropagation(),console.log("space pressed in sample details"),l()?s(M,!0):F(e.sampleId);break}C(a)},V=a=>{a.key===" "&&s(M,!1),C(a)};let lt=r(()=>ga(e.sampleId)),Z=R(void 0);Qe(()=>{s(Z,void 0),s(Xt,void 0)});const Nt=a=>{t(M)||(t(Z)===a?s(Z,void 0):s(Z,a,!0))};let Xt=R(void 0),it=R(!1),S=R(null),W=R(null),K=R(null);const ge=()=>{s(it,!1),s(S,null),s(K,null)};let ht=R(!1);const Yt=10,he=()=>{if(!t(W))return;const a=oa(t(W));let o=null;const k=sa().on("start",L=>{if(!t(ht))return;s(it,!0);const v=t(W).getBoundingClientRect(),B=L.sourceEvent.clientX,x=L.sourceEvent.clientY,D=(B-v.left)/v.width*n().data.width,E=(x-v.top)/v.height*n().data.height;o={x:D,y:E},s(S,{x:D,y:E,width:0,height:0},!0),s(K,{x:D,y:E},!0)}).on("drag",L=>{if(!t(S)||!t(it)||!o)return;const v=t(W).getBoundingClientRect(),B=L.sourceEvent.clientX,x=L.sourceEvent.clientY;let D=(B-v.left)/v.width*n().data.width,E=(x-v.top)/v.height*n().data.height;const Bt=n().data.width,Et=n().data.height;D=Math.max(0,Math.min(D,Bt)),E=Math.max(0,Math.min(E,Et));const nt=Math.min(o.x,D),dt=Math.min(o.y,E),Rt=Math.abs(D-o.x),Ot=Math.abs(E-o.y);s(S,{x:nt,y:dt,width:Rt,height:Ot},!0),s(K,{x:D,y:E},!0)}).on("end",()=>{!t(S)||!t(it)||(t(S).width>Yt&&t(S).height>Yt&&t(at)&&et({x:t(S).x,y:t(S).y,width:t(S).width,height:t(S).height,labelName:t(at).label}),ge(),o=null)});return a.call(k),a.on("mousemove",fe),()=>{k.on("start",null).on("drag",null).on("end",null)}},ve=a=>{if(!t(W)||t(it))return;const o=t(W).getBoundingClientRect(),k=a.clientX,L=a.clientY,v=(k-o.left)/o.width*n().data.width,B=(L-o.top)/o.height*n().data.height;s(K,{x:v,y:B},!0),a.stopPropagation(),a.preventDefault()},fe=Ye.throttle(ve,50);De(()=>{he(),t(G).subscribe(a=>{if(a.isSuccess&&a.data){let o=Ue(a.data);s(Mt,o,!0)}else s(Mt,[],!0)})});let at=R(void 0),Mt=R(te([])),ft=R(te(new Set));const pe=a=>{const o=new Set(t(ft));o.has(a)?o.delete(a):o.add(a),s(ft,o,!0)},_e=r(()=>t(Mt).filter(a=>!t(ft).has(a.annotation_id))),kt=r(()=>t(at)?Ge(t(at).label,1).color:"blue"),be=async a=>{if(!n().data)return;(async()=>{try{await N(a),ct.success("Annotation deleted successfully"),t(g)(),t(Z)===a&&s(Z,void 0)}catch(k){ct.error("Failed to delete annotation. Please try again."),console.error("Error deleting annotation:",k)}})()},xe=async a=>{try{await st(e.sampleId,a),ct.success("Tag removed successfully"),t(g)()}catch(o){ct.error("Failed to remove tag. Please try again."),console.error("Error removing tag from sample:",o)}},we=r(()=>t(M)?"grab":t(ht)?"crosshair":"auto"),ye=r(()=>l()&&!t(M)),Ut=r(()=>t(ht)&&!t(M));let Zt=R(null);var Kt=J();ne("keydown",ee,Pt),ne("keyup",ee,V);var Se=_(Kt);{var $e=a=>{var o=Da(),k=$(o),L=$(k);Ia(L,{get dataset(){return e.dataset},get sampleIndex(){return e.sampleIndex}}),I(k);var v=h(k,2);aa(v,{class:"mb-4 bg-border-hard"});var B=h(v,2),x=$(B),D=$(x);Ze(D,{className:"h-full",children:(nt,dt)=>{Ke(nt,{className:"h-full",children:(Rt,Ot)=>{var Ct=La(),Tt=$(Ct),Lt=$(Tt),Ae=$(Lt);{let q=r(()=>i().has(e.sampleId));Oe(Ae,{onSelect:()=>F(e.sampleId),get isSelected(){return t(q)}})}I(Lt);var jt=h(Lt,2);{var Pe=q=>{var pt=J(),_t=_(pt);It(_t,()=>e.children),c(q,pt)};Y(jt,q=>{e.children&&q(Pe)})}var Me=h(jt,2);ma(Me,{get width(){return n().data.width},get height(){return n().data.height},get cursor(){return t(we)},get boundingBox(){return t(Xt)},zoomableContent:pt=>{var _t=Ta(),Gt=_(_t),ke=h(Gt);{var Be=Dt=>{var Vt=Ca(),bt=_(Vt);let Wt;var qt=$(bt);qe(qt,17,()=>t(_e),f=>f.annotation_id,(f,X)=>{{let O=r(()=>t(Z)===t(X).annotation_id);Aa(f,{get annotationId(){return t(X).annotation_id},get sampleId(){return e.sampleId},get datasetId(){return w},get isResizable(){return t(ye)},get isSelected(){return t(O)},toggleAnnotationSelection:Nt})}});var Jt=h(qt);{var Ee=f=>{ra(f,{get bbox(){return t(S)},get colorStroke(){return t(kt)},colorFill:"rgba(0, 123, 255, 0.1)",style:"outline: 0;",opacity:.8,scale:1})};Y(Jt,f=>{t(S)&&t(it)&&t(at)&&f(Ee)})}var Re=h(Jt);{var Ce=f=>{var X=Ea(),O=_(X),xt=h(O);ut(()=>{H(O,"y1",t(K).y),H(O,"x2",n().data.width),H(O,"y2",t(K).y),H(O,"stroke",t(kt)),H(xt,"x1",t(K).x),H(xt,"x2",t(K).x),H(xt,"y2",n().data.height),H(xt,"stroke",t(kt))}),c(f,X)};Y(Re,f=>{t(K)&&t(Ut)&&f(Ce)})}I(bt);var Te=h(bt);{var Le=f=>{var X=Ra();oe(X,O=>s(W,O),()=>t(W)),ut(()=>{H(X,"width",n().data.width),H(X,"height",n().data.height)}),c(f,X)};Y(Te,f=>{t(Ut)&&f(Le)})}ut(f=>Wt=Je(bt,0,"",null,Wt,f),[()=>({invisible:d()})]),c(Dt,Vt)};Y(ke,Dt=>{n().data&&Dt(Be)})}ut(()=>H(Gt,"href",t(lt))),c(pt,_t)},$$slots:{zoomableContent:!0}}),I(Tt),oe(Tt,q=>s(Zt,q),()=>t(Zt)),I(Ct),c(Rt,Ct)},$$slots:{default:!0}})},$$slots:{default:!0}}),I(x);var E=h(x,2),Bt=$(E);{var Et=nt=>{Ve(nt,{get sample(){return n().data},get annotationsIdsToHide(){return t(ft)},get selectedAnnotationId(){return t(Z)},onAnnotationClick:Nt,onToggleShowAnnotation:pe,onDeleteAnnotation:be,onRemoveTag:xe,get onUpdate(){return t(g)},get addAnnotationEnabled(){return t(ht)},set addAnnotationEnabled(dt){s(ht,dt,!0)},get addAnnotationLabel(){return t(at)},set addAnnotationLabel(dt){s(at,dt,!0)}})};Y(Bt,nt=>{n().data&&nt(Et)})}I(E),I(B),I(o),c(a,o)},Ie=a=>{je(a,{})};Y(Se,a=>{n().data?a($e):a(Ie,!1)})}c(u,Kt),gt(),tt()}var Fa=Q('<div class="flex h-full w-full space-x-4 px-4 pb-4" data-testid="sample-details"><div class="h-full w-full space-y-6 rounded-[1vw] bg-card p-4"><!></div></div>');function rn(u,e){mt(e,!0);const m=r(()=>yt.params.sampleId),l=yt.data.dataset,n=r(()=>Number(yt.params.sampleIndex));var i=Fa(),d=$(i),p=$(d);Ha(p,{get sampleId(){return t(m)},get dataset(){return l},get sampleIndex(){return t(n)},children:(tt,ot)=>{var F=J(),w=_(F);{var z=C=>{var U=J(),N=_(U);It(N,()=>e.children),c(C,U)};Y(w,C=>{e.children&&C(z)})}c(tt,F)},$$slots:{default:!0}}),I(d),I(i),c(u,i),gt()}export{rn as component};
|
lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{6.CrbkRPam.js → 6.DRA5Ru_2.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"../chunks/
|
|
1
|
+
import{r as s}from"../chunks/CfQ4mGwl.js";import{r as d}from"../chunks/D5w4xp5l.js";import{r as n}from"../chunks/B90CZVMX.js";const i=async()=>{const{data:t}=await d();if(!t||t.length===0)throw new Error("No datasets found");const e=t.toSorted((r,o)=>new Date(o.created_at||0).getTime()-new Date(r.created_at||0).getTime())[0],a=e==null?void 0:e.dataset_id;if(!a)throw new Error("No valid dataset ID found");n(307,s.toSamples(a))},m=Object.freeze(Object.defineProperty({__proto__:null,load:i},Symbol.toStringTag,{value:"Module"}));export{m as universal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{p as f,u as $,g as a,a as _,b as o}from"../chunks/Frwd2CjB.js";import{s as i,a as h}from"../chunks/-DXuGN29.js";import{A as S}from"../chunks/Cqo0Vpvt.js";import{u as T}from"../chunks/qIv1kPyv.js";import"../chunks/D_ynJAfY.js";import"../chunks/Bqz7dyEC.js";import"../chunks/D5w4xp5l.js";import"../chunks/DSxvnAMh.js";import"../chunks/69_IOA4Y.js";import"../chunks/DQ8aZ1o-.js";import{u as G}from"../chunks/Cy4fgWTG.js";import"../chunks/DzX_yyqb.js";function q(n,t){f(t,!0);const p=()=>i(c,"$lastGridType",s),e=()=>i(d,"$sampleSize",s),[s,m]=h(),{datasetId:r,sampleSize:d,selectedAnnotationFilterIds:l}=t.data,{lastGridType:c}=T(),u=o(()=>G({dataset_id:r})),g=o(()=>a(u).clearTagsSelected);$(()=>{p()!=="annotations"&&a(g)()}),S(n,{get itemHeight(){return e().height},get itemWidth(){return e().width},get dataset_id(){return r},get selectedAnnotationFilterIds(){return l}}),_(),m()}export{q as component};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{p as U,f as E,n as Qt,a as z,w as Dt,m as _t,$ as gt,g as t,b as i,c as g,r as f,s as S,t as G,Y as pt,ak as Et,au as Ct}from"../chunks/Frwd2CjB.js";import{l as Xt}from"../chunks/D5w4xp5l.js";import{u as xt}from"../chunks/qIv1kPyv.js";import"../chunks/CWj6FrbW.js";import{c as Q,a as m,f as C,t as Nt,b as ta}from"../chunks/CiaNZCBa.js";import{i as T,s as R,a as Y}from"../chunks/-DXuGN29.js";import{e as ht}from"../chunks/Dug7Bq1S.js";import{s as et,e as aa,g as ea,u as na,k as oa,b as sa,t as ia}from"../chunks/D_ynJAfY.js";import{g as at,c as ra}from"../chunks/DQ8aZ1o-.js";import{I as da,s as la,q as nt,y as ca,z as ua,B as va,D as ma,o as bt,E as Bt,F as fa,C as Lt,v as Rt,H as _a,n as jt,f as ga,S as pa}from"../chunks/Cqo0Vpvt.js";import"../chunks/Bqz7dyEC.js";import{p as H}from"../chunks/DSxvnAMh.js";import"../chunks/69_IOA4Y.js";import{S as ha}from"../chunks/CZGpyrcA.js";import{s as ba}from"../chunks/DzX_yyqb.js";import{r as q}from"../chunks/CfQ4mGwl.js";import{S as xa}from"../chunks/DmjAI-UV.js";import{B as Ia,a as Aa,b as tt,c as mt,H as wa,d as ft,D as Sa,e as $a,Z as ya,g as Ma,u as ka}from"../chunks/u-it74zV.js";import{S as Pa}from"../chunks/CSCQddQS.js";import{s as V}from"../chunks/H60ATh8g.js";import{C as Ca}from"../chunks/sLqs1uaK.js";import{s as Na,r as Ba}from"../chunks/Dafy4oEQ.js";function Da(u,a){U(a,!0);/**
|
|
2
|
+
* @license @lucide/svelte v0.482.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* ISC License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
7
|
+
*
|
|
8
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
10
|
+
* copyright notice and this permission notice appear in all copies.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
13
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
14
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
15
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
16
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
17
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
18
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
+
*
|
|
20
|
+
*/let e=Ba(a,["$$slots","$$events","$$legacy"]);const d=[["path",{d:"M5 3a2 2 0 0 0-2 2"}],["path",{d:"M19 3a2 2 0 0 1 2 2"}],["path",{d:"M21 19a2 2 0 0 1-2 2"}],["path",{d:"M5 21a2 2 0 0 1-2-2"}],["path",{d:"M9 3h1"}],["path",{d:"M9 21h1"}],["path",{d:"M14 3h1"}],["path",{d:"M14 21h1"}],["path",{d:"M3 9v1"}],["path",{d:"M21 9v1"}],["path",{d:"M3 14v1"}],["path",{d:"M21 14v1"}]];da(u,Na({name:"square-dashed"},()=>e,{get iconNode(){return d},children:(o,l)=>{var s=Q(),I=E(s);ba(I,()=>a.children??Qt),m(o,s)},$$slots:{default:!0}})),z()}const Ea=({annotationIndex:u,...a})=>{const e=Dt({isLoading:!1});return(async()=>{e.update(o=>({...o,isLoading:!0}));try{const{data:o}=await Xt({path:{dataset_id:a.dataset_id},query:{cursor:u>0?u-1:0,limit:3,annotation_label_ids:a.annotation_label_ids,tag_ids:a.tag_ids}});if(!o){e.update(n=>({...n,isLoading:!1,error:"No annotations data received",data:void 0}));return}const{setAnnotationsTotalCount:l}=xt();l(o.total_count);let s;const I=u>0?o.data[0]:void 0;o.data.length>1&&(s=u===0?o.data[1]:o.data[2]),e.update(n=>({...n,isLoading:!1,error:void 0,data:{annotationNext:s,annotationPrevious:I}}))}catch(o){e.update(l=>({...l,isLoading:!1,error:String(o)}))}})(),e},La=async({parent:u,params:{dataset_id:a,annotationId:e,annotationIndex:d}})=>{const{annotationsSelectedTagsIds:o,annotationsSelectedAnnotationLabelsIds:l,dataset:s}=await u(),I=parseInt(d,10),n=Dt();if(!s)throw new Error("Dataset data not found");return Ea({annotationIndex:I,dataset_id:a,currentAnnotationId:e,annotation_label_ids:Array.from(_t(l)),tag_ids:Array.from(_t(o))}).subscribe(({data:D})=>{n.set(D)}),{annotationAdjacents:n,annotationIndex:I,annotationId:e,dataset:s}},Pe=Object.freeze(Object.defineProperty({__proto__:null,load:La},Symbol.toStringTag,{value:"Module"}));function Ra(u,a){U(a,!0);const e=()=>R(t(s),"$annotationAdjacents",d),[d,o]=Y(),l=i(()=>H.data.annotationIndex),s=i(()=>H.data.annotationAdjacents),I=()=>{e().annotationNext&&at(q.toSampleWithAnnotation({datasetId:e().annotationNext.dataset_id,sampleId:e().annotationNext.sample_id,annotationId:e().annotationNext.annotation_id,annotationIndex:t(l)+1}))},n=()=>{e().annotationPrevious&&at(q.toSampleWithAnnotation({datasetId:e().annotationPrevious.dataset_id,sampleId:e().annotationPrevious.sample_id,annotationId:e().annotationPrevious.annotation_id,annotationIndex:t(l)-1}))},D=p=>{switch(p.key){case"ArrowRight":I();break;case"ArrowLeft":n();break}};var $=Q();ht("keydown",gt,D);var w=E($);{var y=p=>{{let h=i(()=>!!e().annotationPrevious),A=i(()=>!!e().annotationNext);Pa(p,{get hasPrevious(){return t(h)},get hasNext(){return t(A)},onPrevious:n,onNext:I})}};T(w,p=>{e()&&p(y)})}m(u,$),z(),o()}const ja={object_detection:"Object Detection",instance_segmentation:"Instance Segmentation",semantic_segmentation:"Semantic Segmentation",classification:"Classification"};var Ta=C('<span class="text-sm"> </span> <span class="break-all text-sm"> </span>',1);function Ha(u,a){var e=Ta(),d=E(e),o=g(d,!0);f(d);var l=S(d,2),s=g(l,!0);f(l),G(()=>{V(o,a.label),et(l,"data-testid",`annotation-metadata-${a.id}`),V(s,a.value)}),m(u,e)}var Ua=C('<span class="break-all text-sm"> </span>'),za=C('<span class="text-sm"> </span> <!>',1);function Fa(u,a){U(a,!0);const e=()=>R(s,"$result",o),d=()=>R(a.isEditingMode,"$isEditingMode",o),[o,l]=Y(),s=la(),{updateAnnotation:I}=nt({datasetId:a.datasetId,annotationId:a.annotationId,onUpdate:a.onUpdate}),n=i(()=>va(e().data||[])),D=i(()=>{const b=t(n).find(r=>r.value===a.value);return b||{value:a.value,label:a.value}});var $=za(),w=E($),y=g(w,!0);f(w);var p=S(w,2);{var h=b=>{{const r=(x,v)=>{let k=()=>v==null?void 0:v().inputValue;ua(x,{get label(){return k()}})};let c=i(()=>t(n).find(x=>{var v;return x.value===((v=t(D))==null?void 0:v.value)}));ca(b,{get items(){return t(n)},get selectedItem(){return t(c)},name:"annotation-label",placeholder:"Select a label",onSelect:x=>{I({annotation_id:a.annotationId,dataset_id:a.datasetId,label_name:x.value})},notFound:r,$$slots:{notFound:!0}})}},A=b=>{var r=Ua();et(r,"data-testid","annotation-metadata-label");var c=g(r,!0);f(r),G(()=>V(c,a.value)),m(b,r)};T(p,b=>{d()?b(h):b(A,!1)})}G(()=>V(y,a.label)),m(u,$),z(),l()}var Oa=C('<div class="flex flex-col gap-4"><div class="grid grid-cols-[6rem_1fr] gap-y-3 text-diffuse-foreground"></div></div>');function qa(u,a){U(a,!0);const e=()=>R(t(I),"$annotationResp",d),[d,o]=Y(),{datasetId:l}=H.data,s=i(()=>nt({datasetId:l,annotationId:a.annotationId})),I=i(()=>t(s).annotation);let n=i(()=>e().data);const D=i(()=>{var A,b;if(!t(n))return[];let h=[{id:"label",label:"Label:",value:(b=(A=t(n))==null?void 0:A.annotation_label)==null?void 0:b.annotation_label_name},{id:"type",label:"Type:",value:ja[t(n).annotation_type]||"Unknown"}];if(t(n)&&!ma(t(n))){const{height:r,width:c}=bt(t(n));h=[{id:"height",label:"Height:",value:Bt(Math.round(r))+"px"},{id:"width",label:"Width:",value:Bt(Math.round(c))+"px"},...h]}return h}),{isEditingMode:$}=H.data.globalStorage;var w=Q(),y=E(w);{var p=h=>{fa(h,{title:"Annotation details",children:(A,b)=>{var r=Oa(),c=g(r);aa(c,21,()=>t(D),({label:x,value:v,id:k})=>x,(x,v)=>{let k=()=>t(v).label,L=()=>t(v).value,P=()=>t(v).id;var N=Q(),j=E(N);{var F=B=>{Fa(B,{get onUpdate(){return a.onUpdate},get annotationId(){return a.annotationId},get datasetId(){return l},get label(){return k()},get value(){return L()},get isEditingMode(){return $}})},_=B=>{Ha(B,{get label(){return k()},get id(){return P()},get value(){return L()}})};T(j,B=>{P()==="label"&&$?B(F):B(_,!1)})}m(x,N)}),f(c),f(r),m(A,r)}})};T(y,h=>{t(D).length>0&&h(p)})}m(u,w),z(),o()}var Ga=C('<!> <h2 class="py-2 text-lg font-semibold"><a>Check all sample annotations</a></h2>',1),Ka=C('<div class="flex h-full w-full items-center justify-center"><!></div>'),Wa=C('<div class="flex h-full min-h-0 flex-col space-y-4 overflow-hidden dark:[color-scheme:dark]"><!> <!></div>');function Va(u,a){U(a,!0);const{datasetId:e}=H.data;let d=Et(void 0);nt({datasetId:e,annotationId:a.annotationId}).annotation.subscribe(n=>{n.isSuccess&&pt(d,n.data.sample,!0)});const l=ea(),[s,I]=l;Lt(u,{className:"h-full",children:(n,D)=>{Rt(n,{className:"h-full flex flex-col",children:($,w)=>{var y=Wa(),p=g(y);qa(p,{get annotationId(){return a.annotationId},get onUpdate(){return a.onUpdate}});var h=S(p,2);{var A=r=>{var c=Ga(),x=E(c);_a(x,{get sample(){return t(d)},showCustomMetadata:!1});var v=S(x,2),k=g(v);f(v),G(L=>et(k,"href",L),[()=>s(q.toSample({sampleId:t(d).sample_id,datasetId:t(d).dataset_id}),void 0)]),m(r,c)},b=r=>{var c=Ka(),x=g(c);jt(x,{size:"large",align:"center"}),f(c),m(r,c)};T(h,r=>{t(d)?r(A):r(b,!1)})}f(y),m($,y)},$$slots:{default:!0}})},$$slots:{default:!0}}),z()}var Ya=C('<!> <span class="hidden sm:inline">Home</span>',1),Za=C('<!> <span class="max-w-[150px] truncate"> </span>',1),Ja=C('<!> <span class="hidden sm:inline">Annotations</span>',1),Qa=C('<!> <span class="max-w-[200px] truncate"><!></span>',1),Xa=C("<!> <!> <!> <!> <!> <!> <!>",1);function te(u,a){U(a,!0);const e=()=>R(l,"$annotationsTotalCount",d),[d,o]=Y(),{annotationsTotalCount:l}=xt();Ia(u,{class:"mb-2",children:(s,I)=>{Aa(s,{children:(n,D)=>{var $=Xa(),w=E($);tt(w,{children:(c,x)=>{{let v=i(()=>q.toHome());mt(c,{get href(){return t(v)},class:"flex items-center gap-2",children:(k,L)=>{var P=Ya(),N=E(P);wa(N,{class:"h-4 w-4"}),Ct(2),m(k,P)},$$slots:{default:!0}})}},$$slots:{default:!0}});var y=S(w,2);ft(y,{});var p=S(y,2);tt(p,{children:(c,x)=>{{let v=i(()=>q.toAnnotations(a.dataset.dataset_id));mt(c,{get href(){return t(v)},class:"flex items-center gap-2",children:(k,L)=>{var P=Za(),N=E(P);Sa(N,{class:"h-4 w-4"});var j=S(N,2),F=g(j,!0);f(j),G(()=>V(F,a.dataset.name)),m(k,P)},$$slots:{default:!0}})}},$$slots:{default:!0}});var h=S(p,2);ft(h,{});var A=S(h,2);tt(A,{children:(c,x)=>{{let v=i(()=>q.toAnnotations(a.dataset.dataset_id));mt(c,{get href(){return t(v)},class:"flex items-center gap-2",children:(k,L)=>{var P=Ja(),N=E(P);Ca(N,{class:"h-4 w-4"}),Ct(2),m(k,P)},$$slots:{default:!0}})}},$$slots:{default:!0}});var b=S(A,2);ft(b,{});var r=S(b,2);tt(r,{children:(c,x)=>{$a(c,{class:"flex items-center gap-2",children:(v,k)=>{var L=Qa(),P=E(L);Da(P,{class:"h-4 w-4"});var N=S(P,2),j=g(N);{var F=B=>{var K=Nt();G(()=>V(K,`Annotation ${a.annotationIndex+1} of ${e()??""}`)),m(B,K)},_=B=>{var K=Nt("Annotation");m(B,K)};T(j,B=>{a.annotationIndex?B(F):B(_,!1)})}f(N),m(v,L)},$$slots:{default:!0}})},$$slots:{default:!0}}),m(n,$)},$$slots:{default:!0}})},$$slots:{default:!0}}),z(),o()}var ae=ta("<image></image><g><!></g>",1),ee=C('<div class="h-full w-full overflow-hidden"><div class="sample relative h-full w-full"><div class="absolute right-4 top-2 z-30"><!></div> <!> <!></div></div>'),ne=C('<div class="flex h-full w-full items-center justify-center"><!></div>'),oe=C('<div class="flex h-full w-full flex-col space-y-4"><div class="flex w-full items-center"><!></div> <!> <div class="flex min-h-0 flex-1 gap-4"><div class="flex-1"><!></div> <div class="relative w-[375px]"><!></div></div></div>');function se(u,a){U(a,!0);const e=()=>R(Tt,"$isEditingMode",s),d=()=>R(t(P),"$annotationResp",s),o=()=>R(D,"$selectedSampleAnnotationCropIds",s),l=()=>R(y,"$isHidden",s),[s,I]=Y(),{toggleSampleAnnotationCropSelection:n,selectedSampleAnnotationCropIds:D,clearReversibleActionsByGroupId:$,addReversibleAction:w}=xt(),{isHidden:y,handleKeyEvent:p}=ga(),{settingsStore:h}=na(),A=" ",b=_t(h).key_go_back;let r=Et(!1);const c=()=>{var M;(M=a.sample)!=null&&M.dataset_id?at(q.toAnnotations(a.sample.dataset_id)):at("/")},x=M=>{switch(M.key){case b:c();break;case" ":M.preventDefault(),e()?pt(r,!0):n(a.annotationId);break;case A:M.preventDefault(),n(a.annotationId);break}p(M)},v=M=>{M.key===" "&&pt(r,!1),p(M)},k=H.data.datasetId,L=i(()=>nt({datasetId:k,annotationId:a.annotationId})),P=i(()=>t(L).annotation),N=i(()=>t(L).updateAnnotation),j="bbox-change-annotation-details";ra(()=>{$(j)});const F=M=>{if(t(_)){const Z={annotation_id:t(_).annotation_id,dataset_id:t(_).dataset_id,bounding_box:M},rt=bt(t(_)),St=async()=>{const J={annotation_id:t(_).annotation_id,dataset_id:t(_).dataset_id,bounding_box:rt};await t(N)(J)};(async()=>{try{await t(N)(Z),w({id:`bbox-change-${t(_).annotation_id}-${Date.now()}`,description:`Revert bounding box change for annotation ${t(_).annotation_id}`,execute:St,timestamp:new Date,groupId:j})}catch(J){ia.error("Failed to update annotations:"+J.message)}})()}};let _=i(()=>d().data),B=i(()=>{var M,Z;return Ma(((Z=(M=t(_))==null?void 0:M.sample)==null?void 0:Z.sample_id)||"")}),K=i(()=>t(_)?bt(t(_)):void 0);const{isEditingMode:Tt}=H.data.globalStorage,Ht=i(()=>t(r)?"grab":"auto"),Ut=i(()=>e()&&!t(r));var ot=oe();ht("keydown",gt,x),ht("keyup",gt,v);var st=g(ot),zt=g(st);te(zt,{get dataset(){return a.dataset},get annotationIndex(){return a.annotationIndex}}),f(st);var It=S(st,2);ha(It,{class:"mb-4 bg-border-hard"});var At=S(It,2),it=g(At),Ft=g(it);Lt(Ft,{className:"h-full",children:(M,Z)=>{Rt(M,{className:"h-full",children:(rt,St)=>{var dt=Q(),J=E(dt);{var qt=W=>{var O=ee(),X=g(O),lt=g(X),Kt=g(lt);{let yt=i(()=>o().has(a.annotationId));pa(Kt,{onSelect:()=>n(a.annotationId),get isSelected(){return t(yt)}})}f(lt);var $t=S(lt,2);Ra($t,{});var Wt=S($t,2);ya(Wt,{get width(){return t(_).sample.width},get height(){return t(_).sample.height},get cursor(){return t(Ht)},get boundingBox(){return t(K)},zoomableContent:(Vt,ct)=>{let Yt=()=>ct==null?void 0:ct().scale;var Mt=ae(),kt=E(Mt),ut=S(kt);let Pt;var Zt=g(ut);oa(Zt,()=>d().dataUpdatedAt,vt=>{{let Jt=i(()=>({x:0,y:0,width:t(_).sample.width,height:t(_).sample.height}));xa(vt,{get annotation(){return t(_)},showLabel:!0,get scale(){return Yt()},get imageWidth(){return t(_).sample.width},get isResizable(){return t(Ut)},onBoundingBoxChanged:F,get constraintBox(){return t(Jt)}})}}),f(ut),G(vt=>{et(kt,"href",t(B)),Pt=sa(ut,0,"",null,Pt,vt)},[()=>({invisible:l()})]),m(Vt,Mt)},$$slots:{zoomableContent:!0}}),f(X),f(O),m(W,O)},Gt=W=>{var O=ne(),X=g(O);jt(X,{size:"large",align:"center"}),f(O),m(W,O)};T(J,W=>{t(_)?W(qt):W(Gt,!1)})}m(rt,dt)},$$slots:{default:!0}})},$$slots:{default:!0}}),f(it);var wt=S(it,2),Ot=g(wt);Va(Ot,{get annotationId(){return a.annotationId}}),f(wt),f(At),f(ot),m(u,ot),z(),I()}var ie=C('<div class="flex h-full w-full space-x-4 px-4 pb-4" data-testid="annotation-details"><div class="h-full w-full space-y-6 rounded-[1vw] bg-card p-4"><!></div></div>');function Ce(u,a){U(a,!0);const e=()=>R(t($),"$sample",d),[d,o]=Y(),l=i(()=>a.data.annotationId),s=i(()=>a.data.dataset),I=i(()=>a.data.annotationIndex),{sampleId:n}=H.params,D=i(()=>ka({sampleId:n,datasetId:t(s).dataset_id})),$=i(()=>t(D).sample);var w=ie(),y=g(w),p=g(y);{var h=A=>{se(A,{get annotationId(){return t(l)},get annotationIndex(){return t(I)},get dataset(){return t(s)},get sample(){return e().data}})};T(p,A=>{e().data&&t(l)&&t(s)&&A(h)})}f(y),f(w),m(u,w),z(),o()}export{Ce as component,Pe as universal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{a as n,s as d}from"../chunks/-DXuGN29.js";import"../chunks/Cqo0Vpvt.js";import"../chunks/qIv1kPyv.js";import"../chunks/D_ynJAfY.js";import"../chunks/Bqz7dyEC.js";import"../chunks/D5w4xp5l.js";import"../chunks/DSxvnAMh.js";import"../chunks/69_IOA4Y.js";import"../chunks/DQ8aZ1o-.js";import"../chunks/DzX_yyqb.js";import{S as g}from"../chunks/BeWf8-vJ.js";function A(e,r){const t=()=>d(a,"$sampleSize",o),[o,i]=n(),{datasetId:s,sampleSize:a,selectedAnnotationFilterIds:m,globalStorage:{textEmbedding:p}}=r.data;g(e,{get sampleHeight(){return t().height},get sampleWidth(){return t().width},get textEmbedding(){return p},get dataset_id(){return s},get selectedAnnotationFilterIds(){return m}}),i()}export{A as component};
|