lightly-studio 0.3.4__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lightly-studio might be problematic. Click here for more details.
- lightly_studio/api/features.py +3 -5
- lightly_studio/api/routes/api/dataset_tag.py +10 -0
- lightly_studio/api/routes/api/embeddings2d.py +8 -37
- lightly_studio/core/dataset.py +89 -2
- lightly_studio/core/dataset_query/__init__.py +14 -0
- lightly_studio/core/sample.py +33 -1
- lightly_studio/db_manager.py +4 -2
- lightly_studio/dist_lightly_studio_view_app/_app/env.js +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.CN4hnTks.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/{Samples.CIbricz7.css → Samples.C0_eo9eP.css} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.kFFGI0zL.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/{transform.2jKMtOWG.css → transform.sLzR40om.css} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{qIv1kPyv.js → BOmrKuMn.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{B7302SU7.js → BPpOWbDa.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BaFFwDFr.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{CZGpyrcA.js → BiGQqqJP.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{D_JuJOO3.js → BrNKoXwc.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BsaJCCG_.js +96 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{sLqs1uaK.js → BtXGzlpP.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{Frwd2CjB.js → C3xJX0nD.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{H4l0JFh9.js → CANX9QXL.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CAPx0Bfm.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CP9M7pei.js +39 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CWuDkrMZ.js +436 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/ChlxSwqI.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{DzBTnFhV.js → Cj4nZbtb.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{Bqz7dyEC.js → ClzkJBWk.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CpbA3HU7.js +2 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{DQ8aZ1o-.js → D8ZGoCPm.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DMJzr1NB.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{CSCQddQS.js → DNJnBfHs.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{DSxvnAMh.js → DUtlYNuP.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DVxjPOJB.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DmGM9V9Q.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DoEId1MK.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DthpwYR_.js +2 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DyIcJj6J.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/SiegjVo0.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{Dj4O-5se.js → WEyXQRi6.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/gBp1tBnA.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/xQhUoIl9.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/app.Y-sSoz5q.js +2 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.CvxVp0Cu.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/0.0Fm6E-5B.js +4 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{1.Cdy-7S5q.js → 1.DB-0vkHb.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/10.vaUePh5k.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/11.7i7ljNVT.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{12.DcO8wIAc.js → 13.9qy3WtZv.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{2.BIldfkxL.js → 2.Drwwdm7A.js} +95 -94
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{3.BC9z_TWM.js → 3.D3X_-Wan.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{4.D8X_Ch5n.js → 4.C9TqY3tA.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.iRw6HCWX.js +39 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{6.DRA5Ru_2.js → 6.fqfYR7dB.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{7.WVBsruHQ.js → 7.C7gMM-gk.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.C4v1w-oS.js +20 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/9.DbHcSiMn.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/version.json +1 -1
- lightly_studio/dist_lightly_studio_view_app/index.html +14 -14
- lightly_studio/models/caption.py +1 -0
- lightly_studio/models/sample.py +7 -0
- lightly_studio/models/settings.py +5 -0
- lightly_studio/resolvers/dataset_resolver.py +2 -4
- lightly_studio/resolvers/sample_resolver.py +1 -0
- lightly_studio/resolvers/settings_resolver.py +3 -0
- lightly_studio/resolvers/twodim_embedding_resolver.py +29 -0
- lightly_studio/selection/__init__.py +1 -0
- lightly_studio/selection/mundig.py +41 -0
- lightly_studio-0.4.0.dist-info/METADATA +78 -0
- {lightly_studio-0.3.4.dist-info → lightly_studio-0.4.0.dist-info}/RECORD +71 -69
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.B3oFNb6O.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.7Ma7YdVg.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/-DXuGN29.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BeWf8-vJ.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CfQ4mGwl.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CiaNZCBa.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cqo0Vpvt.js +0 -417
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cy4fgWTG.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D5w4xp5l.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DD63uD-T.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D_ynJAfY.js +0 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Dafy4oEQ.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DmjAI-UV.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Dug7Bq1S.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Dv5BSBQG.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DzX_yyqb.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/H60ATh8g.js +0 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/u-it74zV.js +0 -96
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/app.BPc0HQPq.js +0 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.SNvc2nrm.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/0.5jT7P06o.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/10.C_uoESTX.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.CAXhxJu6.js +0 -39
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.BuKUrCEN.js +0 -20
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/9.CUIn1yCR.js +0 -1
- lightly_studio/selection/README.md +0 -6
- lightly_studio-0.3.4.dist-info/METADATA +0 -879
- /lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{11.CWG1ehzT.js → 12.CWG1ehzT.js} +0 -0
- {lightly_studio-0.3.4.dist-info → lightly_studio-0.4.0.dist-info}/WHEEL +0 -0
lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{3.BC9z_TWM.js → 3.D3X_-Wan.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a}from"../chunks/
|
|
1
|
+
import{u as a}from"../chunks/DMJzr1NB.js";import{L as d}from"../chunks/DVxjPOJB.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.D8X_Ch5n.js → 4.C9TqY3tA.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a}from"../chunks/
|
|
1
|
+
import{u as a}from"../chunks/ClzkJBWk.js";import{u as l}from"../chunks/DMJzr1NB.js";import{u as m}from"../chunks/BOmrKuMn.js";import{L as b}from"../chunks/DVxjPOJB.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 gt,f as _,n as le,a as ht,am as te,g as t,b as r,s as h,c as I,r as A,t as mt,m as ft,u as He,Z as s,al as $,ab as ee,$ as ae}from"../chunks/C3xJX0nD.js";import{c as Q,a as c,f as tt,t as ne,d as $t}from"../chunks/CAPx0Bfm.js";import{s as It}from"../chunks/DoEId1MK.js";import{i as Y,s as G,a as Nt}from"../chunks/DmGM9V9Q.js";import{p as yt}from"../chunks/DUtlYNuP.js";import{I as ie,o as Fe,p as ze,q as Ne,r as Xe,t as At,v as Ye,w as Ze,_ as Ue,x as Ke,y as Oe,z as je,C as Ge,B as Ve,D as We,R as qe,n as Je,E as Qe,F as ta}from"../chunks/CWuDkrMZ.js";import{u as de}from"../chunks/BOmrKuMn.js";import{u as ce,k as ea,t as ut,c as H,e as aa,b as na}from"../chunks/DthpwYR_.js";import"../chunks/ClzkJBWk.js";import"../chunks/BaFFwDFr.js";import"../chunks/69_IOA4Y.js";import{a as oa,g as sa}from"../chunks/D8ZGoCPm.js";import"../chunks/gBp1tBnA.js";import{e as oe}from"../chunks/SiegjVo0.js";import{s as ue,r as me,p as ra,b as se}from"../chunks/xQhUoIl9.js";import{S as la}from"../chunks/BiGQqqJP.js";import{r as St}from"../chunks/ChlxSwqI.js";import{s as re}from"../chunks/CpbA3HU7.js";import{B as ia,a as da,b as wt,c as Ft,H as ca,d as zt,D as ua,e as ma,u as ge,Z as ga,g as ha}from"../chunks/BsaJCCG_.js";import{a as va,b as fa,d as pa,e as _a}from"../chunks/DyIcJj6J.js";function ba(u,e){gt(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=me(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"}]];ie(u,ue({name:"file-image"},()=>m,{get iconNode(){return l},children:(n,i)=>{var d=Q(),p=_(d);It(p,()=>e.children??le),c(n,d)},$$slots:{default:!0}})),ht()}function xa(u,e){gt(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=me(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"}]];ie(u,ue({name:"images"},()=>m,{get iconNode(){return l},children:(n,i)=>{var d=Q(),p=_(d);It(p,()=>e.children??le),c(n,d)},$$slots:{default:!0}})),ht()}var wa=tt('<!> <span class="hidden sm:inline">Home</span>',1),ya=tt('<!> <span class="max-w-[150px] truncate"> </span>',1),Sa=tt('<!> <span class="hidden sm:inline">Samples</span>',1),$a=tt('<!> <span class="max-w-[200px] truncate"><!></span>',1),Ia=tt("<!> <!> <!> <!> <!> <!> <!>",1);function Aa(u,e){gt(e,!0);const m=()=>G(i,"$samplesTotalCount",l),[l,n]=Nt(),{samplesTotalCount:i}=de();ia(u,{class:"mb-2","data-testid":"sample-details-breadcrumb",children:(d,p)=>{da(d,{children:(et,ot)=>{var F=Ia(),w=_(F);wt(w,{children:(P,V)=>{{let g=r(()=>St.toHome());Ft(P,{get href(){return t(g)},class:"flex items-center gap-2",children:(M,T)=>{var b=wa(),y=_(b);ca(y,{class:"h-4 w-4"}),te(2),c(M,b)},$$slots:{default:!0}})}},$$slots:{default:!0}});var z=h(w,2);zt(z,{});var C=h(z,2);wt(C,{children:(P,V)=>{{let g=r(()=>St.toSamples(e.dataset.dataset_id));Ft(P,{get href(){return t(g)},class:"flex items-center gap-2",children:(M,T)=>{var b=ya(),y=_(b);ua(y,{class:"h-4 w-4"});var B=h(y,2),at=I(B,!0);A(B),mt(()=>re(at,e.dataset.name)),c(M,b)},$$slots:{default:!0}})}},$$slots:{default:!0}});var Z=h(C,2);zt(Z,{});var N=h(Z,2);wt(N,{children:(P,V)=>{{let g=r(()=>St.toSamples(e.dataset.dataset_id));Ft(P,{get href(){return t(g)},class:"flex items-center gap-2",children:(M,T)=>{var b=Sa(),y=_(b);xa(y,{class:"h-4 w-4"}),te(2),c(M,b)},$$slots:{default:!0}})}},$$slots:{default:!0}});var st=h(N,2);zt(st,{});var rt=h(st,2);wt(rt,{children:(P,V)=>{ma(P,{class:"flex items-center gap-2",children:(g,M)=>{var T=$a(),b=_(T);ba(b,{class:"h-4 w-4"});var y=h(b,2),B=I(y);{var at=W=>{var lt=ne();mt(()=>re(lt,`Sample ${e.sampleIndex+1} of ${m()??""}`)),c(W,lt)},Pt=W=>{var lt=ne("Sample");c(W,lt)};Y(B,W=>{e.sampleIndex!==void 0?W(at):W(Pt,!1)})}A(y),c(g,T)},$$slots:{default:!0}})},$$slots:{default:!0}}),c(et,F)},$$slots:{default:!0}})},$$slots:{default:!0}}),ht(),n()}function Pa(u,e){gt(e,!0);const m=()=>G(t(F),"$annotationResp",i),l=()=>G(t(Z),"$sample",i),n=()=>G(et,"$showAnnotationTextLabelsStore",i),[i,d]=Nt(),p=ra(e,"isResizable",3,!1),{showAnnotationTextLabelsStore:et}=ce(),ot=r(()=>Xe({datasetId:e.datasetId,annotationId:e.annotationId})),F=r(()=>t(ot).annotation),w=r(()=>t(ot).updateAnnotation);let z=r(()=>m().data);const C=r(()=>ge({sampleId:e.sampleId,datasetId:e.datasetId})),Z=r(()=>t(C).sample);let N=r(()=>m().data?Fe(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=Q(),P=_(rt);{var V=g=>{var M=Q(),T=_(M);ea(T,()=>t(N),b=>{ze(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,B)=>{{let at=r(()=>({x:0,y:0,width:l().data.width,height:l().data.height}));Ne(y,{get annotation(){return t(z)},get showLabel(){return n()},get imageWidth(){return l().data.width},get constraintBox(){return t(at)},get isResizable(){return p()},onBoundingBoxChanged:st})}},$$slots:{default:!0}})}),c(g,M)};Y(P,g=>{t(z)&&l().data&&t(N)&&g(V)})}c(u,rt),ht(),d()}const Ma=({datasetId:u})=>{const e=At(va());return e.subscribe(()=>{}),{createAnnotation:l=>new Promise((n,i)=>{ft(e).mutate({path:{dataset_id:u},body:l},{onSuccess:d=>{n(d)},onError:d=>{i(d)}})})}},Ba=()=>{const u=At(fa());return u.subscribe(()=>{}),{createLabel:m=>new Promise((l,n)=>{ft(u).mutate({body:m},{onSuccess:i=>{l(i)},onError:i=>{n(i)}})})}},ka=({datasetId:u})=>{const e=At(pa());return e.subscribe(()=>{}),{deleteAnnotation:l=>new Promise((n,i)=>{ft(e).mutate({path:{dataset_id:u,annotation_id:l}},{onSuccess:()=>{n()},onError:d=>{i(d)}})})}},Ea=({datasetId:u})=>{const e=At(_a());return e.subscribe(()=>{}),{removeTagFromSample:(l,n)=>new Promise((i,d)=>{ft(e).mutate({path:{dataset_id:u,sample_id:l,tag_id:n}},{onSuccess:()=>i(),onError:p=>d(p)})})}};var Ra=$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),Ca=$t('<rect class="select-none" fill="transparent" role="button" style="outline: 0;cursor: crosshair;" tabindex="0"></rect>'),Ta=$t("<g><!><!><!></g><!>",1),Da=$t("<image></image><!>",1),La=tt('<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>'),Ha=tt('<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 Fa(u,e){gt(e,!0);const m=()=>G(T,"$labels",p),l=()=>G(y,"$isEditingMode",p),n=()=>G(t(V),"$sample",p),i=()=>G(ot,"$selectedSampleIds",p),d=()=>G(z,"$isHidden",p),[p,et]=Nt(),{selectedSampleIds:ot,toggleSampleSelection:F}=de(),w=e.dataset.dataset_id,{isHidden:z,handleKeyEvent:C}=Ye(),{settingsStore:Z}=ce(),{deleteAnnotation:N}=ka({datasetId:w}),{removeTagFromSample:st}=Ea({datasetId:w}),rt=()=>{sa(St.toSamples(w))},P=r(()=>ge({sampleId:e.sampleId,datasetId:w})),V=r(()=>t(P).sample),g=r(()=>t(P).refetch),{createAnnotation:M}=Ma({datasetId:w}),T=Ze(),{createLabel:b}=Ba(),{isEditingMode:y}=yt.data.globalStorage;let B=$(!1);const at=async({x:a,y:o,width:k,height:D,labelName:v})=>{if(!m().data)return;let E=m().data.find(x=>x.annotation_label_name===v);E||(E=await b({annotation_label_name:v}));try{const x=await M({sample_id:e.sampleId,annotation_type:"object_detection",x:Math.round(a),y:Math.round(o),width:Math.round(k),height:Math.round(D),annotation_label_id:E.annotation_label_id});return t(g)(),s(U,x.annotation_id,!0),ut.success("Annotation created successfully"),x}catch(x){ut.error("Failed to create annotation. Please try again."),console.error("Error creating annotation:",x);return}},Pt=a=>{switch(a.key){case ft(Z).key_go_back:rt();break;case" ":a.preventDefault(),a.stopPropagation(),console.log("space pressed in sample details"),l()?s(B,!0):F(e.sampleId);break}C(a)},W=a=>{a.key===" "&&s(B,!1),C(a)};let lt=r(()=>ha(e.sampleId)),U=$(void 0),Xt=$(void 0);oa(()=>{var a;s(U,void 0),s(Zt,void 0),(a=t(Xt))==null||a(),s(vt,!1),s(O,void 0)});const Yt=a=>{t(B)||(t(U)===a?s(U,void 0):s(U,a,!0))};let Zt=$(void 0),it=$(!1),S=$(null),q=$(null),K=$(null);const he=()=>{s(it,!1),s(S,null),s(K,null)};let vt=$(!1);const Ut=10,ve=()=>{if(!t(q))return;const a=Oe(t(q));let o=null;const k=je().on("start",D=>{if(!t(vt))return;s(it,!0);const v=t(q).getBoundingClientRect(),E=D.sourceEvent.clientX,x=D.sourceEvent.clientY,L=(E-v.left)/v.width*n().data.width,R=(x-v.top)/v.height*n().data.height;o={x:L,y:R},s(S,{x:L,y:R,width:0,height:0},!0),s(K,{x:L,y:R},!0)}).on("drag",D=>{if(!t(S)||!t(it)||!o)return;const v=t(q).getBoundingClientRect(),E=D.sourceEvent.clientX,x=D.sourceEvent.clientY;let L=(E-v.left)/v.width*n().data.width,R=(x-v.top)/v.height*n().data.height;const Et=n().data.width,Rt=n().data.height;L=Math.max(0,Math.min(L,Et)),R=Math.max(0,Math.min(R,Rt));const nt=Math.min(o.x,L),dt=Math.min(o.y,R),Ct=Math.abs(L-o.x),jt=Math.abs(R-o.y);s(S,{x:nt,y:dt,width:Ct,height:jt},!0),s(K,{x:L,y:R},!0)}).on("end",()=>{!t(S)||!t(it)||(t(S).width>Ut&&t(S).height>Ut&&t(O)&&at({x:t(S).x,y:t(S).y,width:t(S).width,height:t(S).height,labelName:t(O).label}),he(),o=null)});return a.call(k),a.on("mousemove",pe),()=>{k.on("start",null).on("drag",null).on("end",null)}},fe=a=>{if(!t(q)||t(it))return;const o=t(q).getBoundingClientRect(),k=a.clientX,D=a.clientY,v=(k-o.left)/o.width*n().data.width,E=(D-o.top)/o.height*n().data.height;s(K,{x:v,y:E},!0),a.stopPropagation(),a.preventDefault()},pe=Ue.throttle(fe,50);He(()=>{ve(),t(V).subscribe(a=>{if(a.isSuccess&&a.data){let o=Ke(a.data);s(Mt,o,!0)}else s(Mt,[],!0)})});let O=$(void 0),Mt=$(ee([])),pt=$(ee(new Set));const _e=a=>{const o=new Set(t(pt));o.has(a)?o.delete(a):o.add(a),s(pt,o,!0)},be=r(()=>t(Mt).filter(a=>!t(pt).has(a.annotation_id))),Bt=r(()=>t(O)?Qe(t(O).label,1).color:"blue"),xe=async a=>{if(!n().data)return;(async()=>{try{await N(a),ut.success("Annotation deleted successfully"),t(g)(),t(U)===a&&s(U,void 0)}catch(k){ut.error("Failed to delete annotation. Please try again."),console.error("Error deleting annotation:",k)}})()},we=async a=>{try{await st(e.sampleId,a),ut.success("Tag removed successfully"),t(g)()}catch(o){ut.error("Failed to remove tag. Please try again."),console.error("Error removing tag from sample:",o)}},ye=r(()=>t(B)?"grab":t(kt)?"crosshair":"auto"),Se=r(()=>l()&&!t(B)),kt=r(()=>t(vt)&&!t(B)&&t(O)!==void 0);let Kt=$(null);var Ot=Q();oe("keydown",ae,Pt),oe("keyup",ae,W);var $e=_(Ot);{var Ie=a=>{var o=Ha(),k=I(o),D=I(k);Aa(D,{get dataset(){return e.dataset},get sampleIndex(){return e.sampleIndex}}),A(k);var v=h(k,2);la(v,{class:"mb-4 bg-border-hard"});var E=h(v,2),x=I(E),L=I(x);Ge(L,{className:"h-full",children:(nt,dt)=>{Ve(nt,{className:"h-full",children:(Ct,jt)=>{var Tt=La(),Dt=I(Tt),Lt=I(Dt),Pe=I(Lt);{let J=r(()=>i().has(e.sampleId));We(Pe,{onSelect:()=>F(e.sampleId),get isSelected(){return t(J)}})}A(Lt);var Gt=h(Lt,2);{var Me=J=>{var ct=Q(),_t=_(ct);It(_t,()=>e.children),c(J,ct)};Y(Gt,J=>{e.children&&J(Me)})}var Be=h(Gt,2);ga(Be,{get width(){return n().data.width},get height(){return n().data.height},get cursor(){return t(ye)},get boundingBox(){return t(Zt)},registerResetFn:ct=>s(Xt,ct,!0),zoomableContent:ct=>{var _t=Da(),Vt=_(_t),ke=h(Vt);{var Ee=Ht=>{var Wt=Ta(),bt=_(Wt);let qt;var Jt=I(bt);aa(Jt,17,()=>t(be),f=>f.annotation_id,(f,X)=>{{let j=r(()=>t(U)===t(X).annotation_id);Pa(f,{get annotationId(){return t(X).annotation_id},get sampleId(){return e.sampleId},get datasetId(){return w},get isResizable(){return t(Se)},get isSelected(){return t(j)},toggleAnnotationSelection:Yt})}});var Qt=h(Jt);{var Re=f=>{qe(f,{get bbox(){return t(S)},get colorStroke(){return t(Bt)},colorFill:"rgba(0, 123, 255, 0.1)",style:"outline: 0;",opacity:.8,scale:1})};Y(Qt,f=>{t(S)&&t(it)&&t(O)&&f(Re)})}var Ce=h(Qt);{var Te=f=>{var X=Ra(),j=_(X),xt=h(j);mt(()=>{H(j,"y1",t(K).y),H(j,"x2",n().data.width),H(j,"y2",t(K).y),H(j,"stroke",t(Bt)),H(xt,"x1",t(K).x),H(xt,"x2",t(K).x),H(xt,"y2",n().data.height),H(xt,"stroke",t(Bt))}),c(f,X)};Y(Ce,f=>{t(K)&&t(kt)&&f(Te)})}A(bt);var De=h(bt);{var Le=f=>{var X=Ca();se(X,j=>s(q,j),()=>t(q)),mt(()=>{H(X,"width",n().data.width),H(X,"height",n().data.height)}),c(f,X)};Y(De,f=>{t(kt)&&f(Le)})}mt(f=>qt=na(bt,0,"",null,qt,f),[()=>({invisible:d()})]),c(Ht,Wt)};Y(ke,Ht=>{n().data&&Ht(Ee)})}mt(()=>H(Vt,"href",t(lt))),c(ct,_t)},$$slots:{zoomableContent:!0}}),A(Dt),se(Dt,J=>s(Kt,J),()=>t(Kt)),A(Tt),c(Ct,Tt)},$$slots:{default:!0}})},$$slots:{default:!0}}),A(x);var R=h(x,2),Et=I(R);{var Rt=nt=>{ta(nt,{get sample(){return n().data},get annotationsIdsToHide(){return t(pt)},get selectedAnnotationId(){return t(U)},onAnnotationClick:Yt,onToggleShowAnnotation:_e,onDeleteAnnotation:xe,onRemoveTag:we,get onUpdate(){return t(g)},get addAnnotationEnabled(){return t(vt)},set addAnnotationEnabled(dt){s(vt,dt,!0)},get addAnnotationLabel(){return t(O)},set addAnnotationLabel(dt){s(O,dt,!0)}})};Y(Et,nt=>{n().data&&nt(Rt)})}A(R),A(E),A(o),c(a,o)},Ae=a=>{Je(a,{})};Y($e,a=>{n().data?a(Ie):a(Ae,!1)})}c(u,Ot),ht(),et()}var za=tt('<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 ln(u,e){gt(e,!0);const m=r(()=>yt.params.sampleId),l=yt.data.dataset,n=r(()=>Number(yt.params.sampleIndex));var i=za(),d=I(i),p=I(d);Fa(p,{get sampleId(){return t(m)},get dataset(){return l},get sampleIndex(){return t(n)},children:(et,ot)=>{var F=Q(),w=_(F);{var z=C=>{var Z=Q(),N=_(Z);It(N,()=>e.children),c(C,Z)};Y(w,C=>{e.children&&C(z)})}c(et,F)},$$slots:{default:!0}}),A(d),A(i),c(u,i),ht()}export{ln as component};
|
lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{6.DRA5Ru_2.js → 6.fqfYR7dB.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"../chunks/
|
|
1
|
+
import{r as s}from"../chunks/ChlxSwqI.js";import{r as d}from"../chunks/BaFFwDFr.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};
|
lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{7.WVBsruHQ.js → 7.C7gMM-gk.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/CWj6FrbW.js";import{p as f,u as $,g as a,a as _,b as o}from"../chunks/
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{p as f,u as $,g as a,a as _,b as o}from"../chunks/C3xJX0nD.js";import{s as i,a as h}from"../chunks/DmGM9V9Q.js";import{A as S}from"../chunks/CWuDkrMZ.js";import{u as T}from"../chunks/BOmrKuMn.js";import"../chunks/DthpwYR_.js";import"../chunks/ClzkJBWk.js";import"../chunks/BaFFwDFr.js";import"../chunks/DUtlYNuP.js";import"../chunks/69_IOA4Y.js";import"../chunks/D8ZGoCPm.js";import{u as G}from"../chunks/DMJzr1NB.js";import"../chunks/gBp1tBnA.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 z,f as E,n as Xt,a as F,w as Et,m as pt,$ as ht,g as t,b as n,c as p,r as g,s as M,t as q,am as Ct,u as ta,al as Bt,Z as at}from"../chunks/C3xJX0nD.js";import{n as aa}from"../chunks/BaFFwDFr.js";import{u as It}from"../chunks/BOmrKuMn.js";import"../chunks/CWj6FrbW.js";import{c as Q,a as u,f as B,t as Dt,d as ea}from"../chunks/CAPx0Bfm.js";import{i as H,s as j,a as W}from"../chunks/DmGM9V9Q.js";import{e as bt}from"../chunks/SiegjVo0.js";import{c as ot,e as na,g as oa,u as sa,k as ia,b as ra,t as da}from"../chunks/DthpwYR_.js";import{g as nt,c as la,a as ca}from"../chunks/D8ZGoCPm.js";import{I as ua,w as va,r as st,G as ma,H as fa,J as ga,K as _a,o as xt,M as Rt,N as pa,C as Lt,B as jt,O as ha,n as Tt,v as ba,D as xa,q as Ia}from"../chunks/CWuDkrMZ.js";import"../chunks/ClzkJBWk.js";import{p as U}from"../chunks/DUtlYNuP.js";import"../chunks/69_IOA4Y.js";import{S as Aa}from"../chunks/BiGQqqJP.js";import"../chunks/gBp1tBnA.js";import{r as K}from"../chunks/ChlxSwqI.js";import{B as $a,a as wa,b as et,c as gt,H as Sa,d as _t,D as ya,e as Ma,Z as ka,g as Pa,u as Na}from"../chunks/BsaJCCG_.js";import{S as Ca}from"../chunks/DNJnBfHs.js";import{s as V}from"../chunks/CpbA3HU7.js";import{C as Ba}from"../chunks/BtXGzlpP.js";import{s as Da}from"../chunks/DoEId1MK.js";import{s as Ra,r as Ea}from"../chunks/xQhUoIl9.js";function La(l,a){z(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=Ea(a,["$$slots","$$events","$$legacy"]);const v=[["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"}]];ua(l,Ra({name:"square-dashed"},()=>e,{get iconNode(){return v},children:(o,r)=>{var i=Q(),b=E(i);Da(b,()=>a.children??Xt),u(o,i)},$$slots:{default:!0}})),F()}const ja=({annotationIndex:l,...a})=>{const e=Et({isLoading:!1});return(async()=>{e.update(o=>({...o,isLoading:!0}));try{const{data:o}=await aa({path:{dataset_id:a.dataset_id},query:{cursor:l>0?l-1:0,limit:3,annotation_label_ids:a.annotation_label_ids,tag_ids:a.tag_ids}});if(!o){e.update(s=>({...s,isLoading:!1,error:"No annotations data received",data:void 0}));return}const{setAnnotationsTotalCount:r}=It();r(o.total_count);let i;const b=l>0?o.data[0]:void 0;o.data.length>1&&(i=l===0?o.data[1]:o.data[2]),e.update(s=>({...s,isLoading:!1,error:void 0,data:{annotationNext:i,annotationPrevious:b}}))}catch(o){e.update(r=>({...r,isLoading:!1,error:String(o)}))}})(),e},Ta=async({parent:l,params:{dataset_id:a,annotationId:e,annotationIndex:v}})=>{const{annotationsSelectedTagsIds:o,annotationsSelectedAnnotationLabelsIds:r,dataset:i}=await l(),b=parseInt(v,10),s=Et();if(!i)throw new Error("Dataset data not found");return ja({annotationIndex:b,dataset_id:a,currentAnnotationId:e,annotation_label_ids:Array.from(pt(r)),tag_ids:Array.from(pt(o))}).subscribe(({data:S})=>{s.set(S)}),{annotationAdjacents:s,annotationIndex:b,annotationId:e,dataset:i}},Be=Object.freeze(Object.defineProperty({__proto__:null,load:Ta},Symbol.toStringTag,{value:"Module"}));function Ha(l,a){z(a,!0);const e=()=>j(t(i),"$annotationAdjacents",v),[v,o]=W(),r=n(()=>U.data.annotationIndex),i=n(()=>U.data.annotationAdjacents),b=()=>{e().annotationNext&&nt(K.toSampleWithAnnotation({datasetId:e().annotationNext.dataset_id,sampleId:e().annotationNext.sample_id,annotationId:e().annotationNext.annotation_id,annotationIndex:t(r)+1}),{invalidateAll:!0})},s=()=>{e().annotationPrevious&&nt(K.toSampleWithAnnotation({datasetId:e().annotationPrevious.dataset_id,sampleId:e().annotationPrevious.sample_id,annotationId:e().annotationPrevious.annotation_id,annotationIndex:t(r)-1}),{invalidateAll:!0})},S=_=>{switch(_.key){case"ArrowRight":b();break;case"ArrowLeft":s();break}};var k=Q();bt("keydown",ht,S);var I=E(k);{var R=_=>{{let A=n(()=>!!e().annotationPrevious),$=n(()=>!!e().annotationNext);Ca(_,{get hasPrevious(){return t(A)},get hasNext(){return t($)},onPrevious:s,onNext:b})}};H(I,_=>{e()&&_(R)})}u(l,k),F(),o()}const Ua={object_detection:"Object Detection",instance_segmentation:"Instance Segmentation",semantic_segmentation:"Semantic Segmentation",classification:"Classification"};var za=B('<span class="text-sm"> </span> <span class="break-all text-sm"> </span>',1);function Fa(l,a){var e=za(),v=E(e),o=p(v,!0);g(v);var r=M(v,2),i=p(r,!0);g(r),q(()=>{V(o,a.label),ot(r,"data-testid",`annotation-metadata-${a.id}`),V(i,a.value)}),u(l,e)}var Oa=B('<span class="break-all text-sm"> </span>'),Ga=B('<span class="text-sm"> </span> <!>',1);function Ka(l,a){z(a,!0);const e=()=>j(i,"$result",o),v=()=>j(a.isEditingMode,"$isEditingMode",o),[o,r]=W(),i=va(),{updateAnnotation:b}=st({datasetId:a.datasetId,annotationId:a.annotationId,onUpdate:a.onUpdate}),s=n(()=>ga(e().data||[])),S=n(()=>{const w=t(s).find(d=>d.value===a.value);return w||{value:a.value,label:a.value}});var k=Ga(),I=E(k),R=p(I,!0);g(I);var _=M(I,2);{var A=w=>{{const d=(P,m)=>{let C=()=>m==null?void 0:m().inputValue;fa(P,{get label(){return C()}})};let h=n(()=>t(s).find(P=>{var m;return P.value===((m=t(S))==null?void 0:m.value)}));ma(w,{get items(){return t(s)},get selectedItem(){return t(h)},name:"annotation-label",placeholder:"Select or create a label",onSelect:P=>{b({annotation_id:a.annotationId,dataset_id:a.datasetId,label_name:P.value})},notFound:d,$$slots:{notFound:!0}})}},$=w=>{var d=Oa();ot(d,"data-testid","annotation-metadata-label");var h=p(d,!0);g(d),q(()=>V(h,a.value)),u(w,d)};H(_,w=>{v()?w(A):w($,!1)})}q(()=>V(R,a.label)),u(l,k),F(),r()}var qa=B('<div class="flex flex-col gap-4"><div class="grid grid-cols-[6rem_1fr] gap-y-3 text-diffuse-foreground"></div></div>');function Wa(l,a){z(a,!0);const e=()=>j(t(b),"$annotationResp",v),[v,o]=W(),{datasetId:r}=U.data,i=n(()=>st({datasetId:r,annotationId:a.annotationId})),b=n(()=>t(i).annotation);let s=n(()=>e().data);const S=n(()=>{var $,w;if(!t(s))return[];let A=[{id:"label",label:"Label:",value:(w=($=t(s))==null?void 0:$.annotation_label)==null?void 0:w.annotation_label_name},{id:"type",label:"Type:",value:Ua[t(s).annotation_type]||"Unknown"}];if(t(s)&&!_a(t(s))){const{height:d,width:h}=xt(t(s));A=[{id:"height",label:"Height:",value:Rt(Math.round(d))+"px"},{id:"width",label:"Width:",value:Rt(Math.round(h))+"px"},...A]}return A}),{isEditingMode:k}=U.data.globalStorage;var I=Q(),R=E(I);{var _=A=>{pa(A,{title:"Annotation details",children:($,w)=>{var d=qa(),h=p(d);na(h,21,()=>t(S),({label:P,value:m,id:C})=>P,(P,m)=>{let C=()=>t(m).label,y=()=>t(m).value,f=()=>t(m).id;var x=Q(),L=E(x);{var T=D=>{Ka(D,{get onUpdate(){return a.onUpdate},get annotationId(){return a.annotationId},get datasetId(){return r},get label(){return C()},get value(){return y()},get isEditingMode(){return k}})},c=D=>{Fa(D,{get label(){return C()},get id(){return f()},get value(){return y()}})};H(L,D=>{f()==="label"&&k?D(T):D(c,!1)})}u(P,x)}),g(h),g(d),u($,d)}})};H(R,A=>{t(S).length>0&&A(_)})}u(l,I),F(),o()}var Za=B('<!> <h2 class="py-2 text-lg font-semibold"><a>Check all sample annotations</a></h2>',1),Va=B('<div class="flex h-full w-full items-center justify-center"><!></div>'),Ja=B('<div class="flex h-full min-h-0 flex-col space-y-4 overflow-hidden dark:[color-scheme:dark]"><!> <!></div>');function Ya(l,a){z(a,!0);const e=()=>j(t(b),"$annotationResp",v),[v,o]=W(),{datasetId:r}=U.data,i=n(()=>st({datasetId:r,annotationId:a.annotationId})),b=n(()=>t(i).annotation);let s=n(()=>e().data),S=n(()=>{var _;return(_=t(s))==null?void 0:_.sample});const k=oa(),[I,R]=k;Lt(l,{className:"h-full",children:(_,A)=>{jt(_,{className:"h-full flex flex-col",children:($,w)=>{var d=Ja(),h=p(d);Wa(h,{get annotationId(){return a.annotationId},get onUpdate(){return a.onUpdate}});var P=M(h,2);{var m=y=>{var f=Za(),x=E(f);ha(x,{get sample(){return t(S)},showCustomMetadata:!1});var L=M(x,2),T=p(L);g(L),q(c=>ot(T,"href",c),[()=>I(K.toSample({sampleId:t(S).sample_id,datasetId:t(S).dataset_id}),void 0)]),u(y,f)},C=y=>{var f=Va(),x=p(f);Tt(x,{size:"large",align:"center"}),g(f),u(y,f)};H(P,y=>{t(S)?y(m):y(C,!1)})}g(d),u($,d)},$$slots:{default:!0}})},$$slots:{default:!0}}),F(),o()}var Qa=B('<!> <span class="hidden sm:inline">Home</span>',1),Xa=B('<!> <span class="max-w-[150px] truncate"> </span>',1),te=B('<!> <span class="hidden sm:inline">Annotations</span>',1),ae=B('<!> <span class="max-w-[200px] truncate"><!></span>',1),ee=B("<!> <!> <!> <!> <!> <!> <!>",1);function ne(l,a){z(a,!0);const e=()=>j(r,"$annotationsTotalCount",v),[v,o]=W(),{annotationsTotalCount:r}=It();$a(l,{class:"mb-2",children:(i,b)=>{wa(i,{children:(s,S)=>{var k=ee(),I=E(k);et(I,{children:(h,P)=>{{let m=n(()=>K.toHome());gt(h,{get href(){return t(m)},class:"flex items-center gap-2",children:(C,y)=>{var f=Qa(),x=E(f);Sa(x,{class:"h-4 w-4"}),Ct(2),u(C,f)},$$slots:{default:!0}})}},$$slots:{default:!0}});var R=M(I,2);_t(R,{});var _=M(R,2);et(_,{children:(h,P)=>{{let m=n(()=>K.toAnnotations(a.dataset.dataset_id));gt(h,{get href(){return t(m)},class:"flex items-center gap-2",children:(C,y)=>{var f=Xa(),x=E(f);ya(x,{class:"h-4 w-4"});var L=M(x,2),T=p(L,!0);g(L),q(()=>V(T,a.dataset.name)),u(C,f)},$$slots:{default:!0}})}},$$slots:{default:!0}});var A=M(_,2);_t(A,{});var $=M(A,2);et($,{children:(h,P)=>{{let m=n(()=>K.toAnnotations(a.dataset.dataset_id));gt(h,{get href(){return t(m)},class:"flex items-center gap-2",children:(C,y)=>{var f=te(),x=E(f);Ba(x,{class:"h-4 w-4"}),Ct(2),u(C,f)},$$slots:{default:!0}})}},$$slots:{default:!0}});var w=M($,2);_t(w,{});var d=M(w,2);et(d,{children:(h,P)=>{Ma(h,{class:"flex items-center gap-2",children:(m,C)=>{var y=ae(),f=E(y);La(f,{class:"h-4 w-4"});var x=M(f,2),L=p(x);{var T=D=>{var O=Dt();q(()=>V(O,`Annotation ${a.annotationIndex+1} of ${e()??""}`)),u(D,O)},c=D=>{var O=Dt("Annotation");u(D,O)};H(L,D=>{a.annotationIndex!==void 0?D(T):D(c,!1)})}g(x),u(m,y)},$$slots:{default:!0}})},$$slots:{default:!0}}),u(s,k)},$$slots:{default:!0}})},$$slots:{default:!0}}),F(),o()}var oe=ea("<image></image><g><!></g>",1),se=B('<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>'),ie=B('<div class="flex h-full w-full items-center justify-center"><!></div>'),re=B('<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 de(l,a){z(a,!0);const e=()=>j(Ht,"$isEditingMode",i),v=()=>j(t(f),"$annotationResp",i),o=()=>j(S,"$selectedSampleAnnotationCropIds",i),r=()=>j(R,"$isHidden",i),[i,b]=W(),{toggleSampleAnnotationCropSelection:s,selectedSampleAnnotationCropIds:S,clearReversibleActionsByGroupId:k,addReversibleAction:I}=It(),{isHidden:R,handleKeyEvent:_}=ba(),{settingsStore:A}=sa(),$=" ",w=pt(A).key_go_back;let d=Bt(!1);const h=()=>{var N;(N=a.sample)!=null&&N.dataset_id?nt(K.toAnnotations(a.sample.dataset_id)):nt("/")},P=N=>{switch(N.key){case w:h();break;case" ":N.preventDefault(),e()?at(d,!0):s(a.annotationId);break;case $:N.preventDefault(),s(a.annotationId);break}_(N)},m=N=>{N.key===" "&&at(d,!1),_(N)},C=U.data.datasetId,y=n(()=>st({datasetId:C,annotationId:a.annotationId})),f=n(()=>t(y).annotation),x=n(()=>t(y).updateAnnotation),L="bbox-change-annotation-details";la(()=>{k(L)});const T=N=>{if(t(c)){const J={annotation_id:t(c).annotation_id,dataset_id:t(c).dataset_id,bounding_box:N},lt=xt(t(c)),St=async()=>{const Y={annotation_id:t(c).annotation_id,dataset_id:t(c).dataset_id,bounding_box:lt};await t(x)(Y)};(async()=>{try{await t(x)(J),I({id:`bbox-change-${t(c).annotation_id}-${Date.now()}`,description:`Revert bounding box change for annotation ${t(c).annotation_id}`,execute:St,timestamp:new Date,groupId:L})}catch(Y){da.error("Failed to update annotations:"+Y.message)}})()}};let c=n(()=>v().data),D=n(()=>{var N,J;return Pa(((J=(N=t(c))==null?void 0:N.sample)==null?void 0:J.sample_id)||"")}),O=n(()=>t(c)?xt(t(c)):void 0);const{isEditingMode:Ht}=U.data.globalStorage,Ut=n(()=>t(d)?"grab":"auto"),zt=n(()=>e()&&!t(d));let X=Bt(void 0);ta(()=>{!t(X)&&t(O)&&at(X,t(O),!0)}),ca(()=>{at(X,void 0)});var it=re();bt("keydown",ht,P),bt("keyup",ht,m);var rt=p(it),Ft=p(rt);ne(Ft,{get dataset(){return a.dataset},get annotationIndex(){return a.annotationIndex}}),g(rt);var At=M(rt,2);Aa(At,{class:"mb-4 bg-border-hard"});var $t=M(At,2),dt=p($t),Ot=p(dt);Lt(Ot,{className:"h-full",children:(N,J)=>{jt(N,{className:"h-full",children:(lt,St)=>{var ct=Q(),Y=E(ct);{var Kt=Z=>{var G=se(),tt=p(G),ut=p(tt),Wt=p(ut);{let Mt=n(()=>o().has(a.annotationId));xa(Wt,{onSelect:()=>s(a.annotationId),get isSelected(){return t(Mt)}})}g(ut);var yt=M(ut,2);Ha(yt,{});var Zt=M(yt,2);ka(Zt,{get width(){return t(c).sample.width},get height(){return t(c).sample.height},get cursor(){return t(Ut)},get boundingBox(){return t(X)},zoomableContent:(Vt,vt)=>{let Jt=()=>vt==null?void 0:vt().scale;var kt=oe(),Pt=E(kt),mt=M(Pt);let Nt;var Yt=p(mt);ia(Yt,()=>v().dataUpdatedAt,ft=>{{let Qt=n(()=>({x:0,y:0,width:t(c).sample.width,height:t(c).sample.height}));Ia(ft,{get annotation(){return t(c)},showLabel:!0,get scale(){return Jt()},get imageWidth(){return t(c).sample.width},get isResizable(){return t(zt)},onBoundingBoxChanged:T,get constraintBox(){return t(Qt)}})}}),g(mt),q(ft=>{ot(Pt,"href",t(D)),Nt=ra(mt,0,"",null,Nt,ft)},[()=>({invisible:r()})]),u(Vt,kt)},$$slots:{zoomableContent:!0}}),g(tt),g(G),u(Z,G)},qt=Z=>{var G=ie(),tt=p(G);Tt(tt,{size:"large",align:"center"}),g(G),u(Z,G)};H(Y,Z=>{t(c)?Z(Kt):Z(qt,!1)})}u(lt,ct)},$$slots:{default:!0}})},$$slots:{default:!0}}),g(dt);var wt=M(dt,2),Gt=p(wt);Ya(Gt,{get annotationId(){return a.annotationId}}),g(wt),g($t),g(it),u(l,it),F(),b()}var le=B('<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 De(l,a){z(a,!0);const e=()=>j(t(k),"$sample",v),[v,o]=W(),r=n(()=>a.data.annotationId),i=n(()=>a.data.dataset),b=n(()=>a.data.annotationIndex),s=n(()=>U.params.sampleId),S=n(()=>Na({sampleId:t(s),datasetId:t(i).dataset_id})),k=n(()=>t(S).sample);var I=le(),R=p(I),_=p(R);{var A=$=>{de($,{get annotationId(){return t(r)},get annotationIndex(){return t(b)},get dataset(){return t(i)},get sample(){return e().data}})};H(_,$=>{e().data&&t(r)&&t(i)&&$(A)})}g(R),g(I),u(l,I),F(),o()}export{De as component,Be as universal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{p as Se,al as I,ab as ze,u as xe,g as e,b as d,Z as h,c as v,s as V,f as R,r as f,t as le,a as ye,w as He,m as _e,am as Ne}from"../chunks/C3xJX0nD.js";import{f as T,c as D,a as l}from"../chunks/CAPx0Bfm.js";import{i as W,a as Te,s as ve}from"../chunks/DmGM9V9Q.js";import{a as We,S as qe,e as Fe,s as oe,u as Oe,k as je,b as Ke}from"../chunks/DthpwYR_.js";import{p as P,r as Qe,b as ke}from"../chunks/xQhUoIl9.js";import{r as Re,u as Ve}from"../chunks/DyIcJj6J.js";import{h as Ae,i as te,s as Be,j as Ge,k as Ee,l as Ye,n as Ie,L as Ze}from"../chunks/CWuDkrMZ.js";import{S as De}from"../chunks/BiGQqqJP.js";import{u as Je}from"../chunks/BOmrKuMn.js";import"../chunks/ClzkJBWk.js";import"../chunks/BaFFwDFr.js";import"../chunks/DUtlYNuP.js";import"../chunks/69_IOA4Y.js";import"../chunks/D8ZGoCPm.js";import"../chunks/gBp1tBnA.js";import{I as Ue}from"../chunks/CP9M7pei.js";import{s as Z}from"../chunks/DoEId1MK.js";import{s as Xe}from"../chunks/CpbA3HU7.js";const $e=Be(),et=Ge();var tt=T("<div><!></div>"),it=T("<div><!></div>"),at=T("<div><!></div>"),rt=T("<div><!></div>"),st=T("<div><!></div>"),ot=T("<div><!> <div><!> <!></div> <!></div>");function lt(q,i){Se(i,!0);let m=P(i,"height",3,"100%"),k=P(i,"width",3,"100%"),p=P(i,"stickyIndices",19,()=>[]),M=P(i,"overScan",3,1),b=P(i,"marginLeft",3,0),o=P(i,"marginTop",3,0),O=P(i,"layout",3,"vertical"),w=P(i,"scrollPosition",15,0),ie=P(i,"scrollAlignment",3,"auto"),z=P(i,"scrollBehavior",3,"auto"),fe=P(i,"getKey",3,t=>t),ae=Qe(i,["$$slots","$$events","$$legacy","itemCount","itemSize","height","width","stickyIndices","overScan","marginLeft","marginTop","layout","scrollPosition","scrollAlignment","scrollBehavior","getKey","onscroll","header","item","placeholder","footer"]),_=I(void 0),j=I(ze(w())),re=I(0),A=I(0),ne=I(0),de=I(0),J=I(0),U=I(0),B=I(ze([])),K=!1,X=!1,G=I(!1);function me(t,r=ie(),g=z()){u(ue(t,r),g)}function he(t,r=z()){u(t,r)}const ue=(t,r)=>{const g=e(c)?o()+e(re):b()+e(A),S=t*i.itemSize+g,N=S-e(L)+i.itemSize+g;let a;switch(r){case"start":a=S;break;case"center":a=S-(e(L)-i.itemSize)/2;break;case"end":a=N;break;default:a=Math.max(N,Math.min(S,w()));break}return Math.max(0,Math.min(e(ce)-e(L),a))},u=(t,r=z())=>{e(_)&&(K=!0,e(_).scrollTo({[e(c)?"top":"left"]:t,behavior:r}),K=!1)},Q=t=>{e(_)&&!K&&!X&&(K=!0,e(_).scrollTo({top:t,behavior:z()}),K=!1)},se=t=>{const r=t*i.itemSize;return`position: absolute; transform: translate3d(${e(c)?`${b()}px, ${r+o()}px`:`${e(A)+r+b()}px, ${o()}px`}, 0px); ${e(pe)} will-change: transform;`},ge=t=>{X=!0,K||(e(c)?(h(j,Math.max(0,t.currentTarget.scrollTop-e(re)),!0),w(t.currentTarget.scrollTop)):(h(j,Math.max(0,t.currentTarget.scrollLeft-e(A)),!0),w(t.currentTarget.scrollLeft)),e(C)(e(j))),$e(()=>{X=!1})};let c=d(()=>O()==="vertical"),ce=d(()=>i.itemCount*i.itemSize),pe=d(()=>e(c)?`height: ${i.itemSize}px; width: ${b()>0?`${e(U)-b()}px`:"100%"};`:`height: ${o()>0?`${e(de)-o()}px`:"100%"}; width: ${i.itemSize}px;`),L=d(()=>e(c)?e(ne):e(J));xe(()=>{e(L)&&h(B,Ae(i.itemCount,i.itemSize,e(L),M(),e(j)),!0)}),xe(()=>{e(_)&&Q(w())});let C=d(()=>et(e(L),{fast:()=>{h(G,!0)},slow:()=>{h(G,!1)}}));var $={scrollToIndex:me,scrollToPosition:he},x=ot(),F=t=>{var r;ge(t),(r=i.onscroll)==null||r.call(i,t)};We(x,t=>({onscroll:F,...ae,[qe]:t}),[()=>({position:"relative",overflow:"auto",height:typeof m()=="number"?`${m()}px`:m(),width:typeof k()!="number"?k():`${k()}px`})]);var H=v(x);{var E=t=>{var r=D(),g=R(r);{var S=a=>{var s=tt(),n=v(s);Z(n,()=>i.header),f(s),te(s,"offsetHeight",y=>h(re,y)),l(a,s)},N=a=>{var s=it();oe(s,"",{},{position:"absolute"});var n=v(s);Z(n,()=>i.header),f(s),te(s,"offsetWidth",y=>h(A,y)),l(a,s)};W(g,a=>{e(c)?a(S):a(N,!1)})}l(t,r)};W(H,t=>{i.header&&t(E)})}var ee=V(H,2);let be;var we=v(ee);{var Ce=t=>{const r=d(()=>Math.max(...p().filter(a=>a<e(B)[0])));var g=D(),S=R(g);{var N=a=>{var s=at();let n;var y=v(s);Z(y,()=>i.item,()=>({index:e(r),style:""})),f(s),le(Y=>n=oe(s,"",n,Y),[()=>({position:"sticky",top:e(c)?`${o()}px`:"0px",left:e(c)?"0px":`${b()}px`,"z-index":"1"})]),l(a,s)};W(S,a=>{e(r)>=0&&a(N)})}l(t,g)};W(we,t=>{p().length&&e(B).length&&t(Ce)})}var Pe=V(we,2);Fe(Pe,17,()=>e(B),t=>fe()(t),(t,r)=>{const g=d(()=>se(e(r)));var S=D(),N=R(S);{var a=n=>{var y=D(),Y=R(y);Z(Y,()=>i.item,()=>({index:e(r),style:e(g)})),l(n,y)},s=n=>{var y=D(),Y=R(y);Z(Y,()=>i.placeholder,()=>({index:e(r),style:e(g)})),l(n,y)};W(N,n=>{!e(G)||!i.placeholder?n(a):n(s,!1)})}l(t,S)}),f(ee);var Me=V(ee,2);{var Le=t=>{var r=D(),g=R(r);{var S=a=>{var s=rt(),n=v(s);Z(n,()=>i.footer),f(s),l(a,s)},N=a=>{var s=st();let n;var y=v(s);Z(y,()=>i.footer),f(s),le(Y=>n=oe(s,"",n,Y),[()=>({position:"absolute",top:"0px",left:`${e(A)+i.itemCount*i.itemSize+b()}px`})]),l(a,s)};W(g,a=>{e(c)?a(S):a(N,!1)})}l(t,r)};W(Me,t=>{i.footer&&t(Le)})}return f(x),ke(x,t=>h(_,t),()=>e(_)),le(t=>be=oe(ee,"",be,t),[()=>({height:e(c)?`${e(ce)}px`:"100%",width:e(c)?"100%":`${e(ce)}px`})]),te(x,"offsetHeight",t=>h(ne,t)),te(x,"clientHeight",t=>h(de,t)),te(x,"offsetWidth",t=>h(J,t)),te(x,"clientWidth",t=>h(U,t)),l(q,x),ye($)}const nt=(...q)=>{const i=Re(...q),m=Ee({...i,getNextPageParam:o=>o.nextCursor||void 0}),k=Ve(),p=()=>{k.invalidateQueries({queryKey:i.queryKey})},M=He([]);return m.subscribe(o=>{if(o.isSuccess){const O=o.data.pages.flatMap(w=>w.data);M.set(O)}}),{data:M,loadMore:()=>{_e(m).hasNextPage&&!_e(m).isFetchingNextPage&&_e(m).fetchNextPage()},query:m,refresh:p}};var dt=T('<div class="flex flex-row items-center gap-10"><!> <div class="flex-1 text-sm text-foreground"> </div></div>');function ct(q,i){Se(i,!0);const m=()=>ve(M,"$gridViewSampleRenderingStore",k),[k,p]=Te(),{gridViewSampleRenderingStore:M}=Oe();let b=d(m);var o=dt(),O=v(o);Ye(O,{get sample(){return i.item.sample},get objectFit(){return e(b)}});var w=V(O,2),ie=v(w,!0);f(w),f(o),le(()=>Xe(ie,i.item.text)),l(q,o),ye(),p()}var vt=T('<div class="flex h-full w-full items-center justify-center"><!> <div>Loading samples...</div></div>'),ft=T("<div><!></div>"),mt=T('<div class="flex justify-center p-4"><!></div>'),ht=T("<!> <!>",1),ut=T('<div class="flex flex-1 flex-col space-y-4"><div class="my-2 flex items-center space-x-4"><div class="flex-1"><div class="text-2xl font-semibold">Captions</div></div> <div class="w-4/12"><!></div></div> <!> <div class="h-full w-full flex-1 overflow-hidden"><!></div></div>');function gt(q,i){Se(i,!0);const m=()=>ve(e(O),"$data",M),k=()=>ve(fe,"$sampleSize",M),p=()=>ve(e(w),"$query",M),[M,b]=Te(),o=d(()=>nt({path:{dataset_id:i.datasetId}})),O=d(()=>e(o).data),w=d(()=>e(o).query),ie=d(()=>e(o).loadMore);let z=I(null);const{sampleSize:fe}=Je();let ae=I(0);xe(()=>{if(!e(z))return;h(ae,e(z).clientHeight,!0);const u=new ResizeObserver(()=>{e(z)&&h(ae,e(z).clientHeight,!0)});return u.observe(e(z)),()=>{u.disconnect()}});let _=d(m);const j=16,re=d(()=>k().height+j),A=d(()=>k().width),ne=d(()=>k().height),de=d(()=>e(ae)+j);var J=ut(),U=v(J),B=V(v(U),2),K=v(B);Ue(K,{}),f(B),f(U);var X=V(U,2);De(X,{class:"mb-4 bg-border-hard"});var G=V(X,2),me=v(G);{var he=u=>{var Q=vt(),se=v(Q);Ie(se,{}),Ne(2),f(Q),l(u,Q)},ue=u=>{var Q=D(),se=R(Q);{var ge=c=>{lt(c,{get itemCount(){return e(_).length},get itemSize(){return e(re)},get height(){return e(de)},class:"dark:[color-scheme:dark]",get style(){return`--sample-width: ${e(A)??""}px; --sample-height: ${e(ne)??""}px;`},item:(L,C)=>{let $=()=>C==null?void 0:C().index,x=()=>C==null?void 0:C().style;var F=ft();Ke(F,1,`pb-[${j}]`);var H=v(F);ct(H,{get item(){return e(_)[$()]}}),f(F),le(()=>oe(F,x())),l(L,F)},footer:L=>{var C=ht(),$=R(C);je($,()=>e(_).length,H=>{{let E=d(()=>!p().hasNextPage||p().isFetchingNextPage);Ze(H,{get onIntersect(){return e(ie)},get disabled(){return e(E)}})}});var x=V($,2);{var F=H=>{var E=mt(),ee=v(E);Ie(ee,{}),f(E),l(H,E)};W(x,H=>{p().isFetchingNextPage&&H(F)})}l(L,C)},$$slots:{item:!0,footer:!0}})};W(se,c=>{p().isSuccess&&e(_).length>0&&c(ge)},!0)}l(u,Q)};W(me,u=>{p().isPending&&e(_).length===0?u(he):u(ue,!1)})}f(G),ke(G,u=>h(z,u),()=>e(z)),f(J),l(q,J),ye(),b()}function Ft(q,i){const{datasetId:m}=i.data;gt(q,{get datasetId(){return m}})}export{Ft as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1761033043766"}
|
|
@@ -5,36 +5,36 @@
|
|
|
5
5
|
<link rel="icon" href="/favicon.png" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
7
|
|
|
8
|
-
<link rel="modulepreload" href="/_app/immutable/entry/start.
|
|
9
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
10
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
8
|
+
<link rel="modulepreload" href="/_app/immutable/entry/start.CvxVp0Cu.js">
|
|
9
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/D8ZGoCPm.js">
|
|
10
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/C3xJX0nD.js">
|
|
11
11
|
<link rel="modulepreload" href="/_app/immutable/chunks/DIeogL5L.js">
|
|
12
12
|
<link rel="modulepreload" href="/_app/immutable/chunks/CYgJF_JY.js">
|
|
13
|
-
<link rel="modulepreload" href="/_app/immutable/entry/app.
|
|
13
|
+
<link rel="modulepreload" href="/_app/immutable/entry/app.Y-sSoz5q.js">
|
|
14
14
|
<link rel="modulepreload" href="/_app/immutable/chunks/C1FmrZbK.js">
|
|
15
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
15
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/WEyXQRi6.js">
|
|
16
16
|
<link rel="modulepreload" href="/_app/immutable/chunks/CWj6FrbW.js">
|
|
17
17
|
<link rel="modulepreload" href="/_app/immutable/chunks/69_IOA4Y.js">
|
|
18
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
19
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
20
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
21
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
22
|
-
<link rel="modulepreload" href="/_app/immutable/chunks
|
|
23
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/
|
|
18
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/BPpOWbDa.js">
|
|
19
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/CpbA3HU7.js">
|
|
20
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/SiegjVo0.js">
|
|
21
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/CAPx0Bfm.js">
|
|
22
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/DmGM9V9Q.js">
|
|
23
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/xQhUoIl9.js">
|
|
24
24
|
</head>
|
|
25
25
|
<body data-sveltekit-preload-data="hover" class="flex h-screen w-screen flex-col dark:bg-black">
|
|
26
26
|
<div style="display: contents">
|
|
27
27
|
<script>
|
|
28
28
|
{
|
|
29
|
-
|
|
29
|
+
__sveltekit_6ycv9w = {
|
|
30
30
|
base: ""
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const element = document.currentScript.parentElement;
|
|
34
34
|
|
|
35
35
|
Promise.all([
|
|
36
|
-
import("/_app/immutable/entry/start.
|
|
37
|
-
import("/_app/immutable/entry/app.
|
|
36
|
+
import("/_app/immutable/entry/start.CvxVp0Cu.js"),
|
|
37
|
+
import("/_app/immutable/entry/app.Y-sSoz5q.js")
|
|
38
38
|
]).then(([kit, app]) => {
|
|
39
39
|
kit.start(app, element);
|
|
40
40
|
});
|
lightly_studio/models/caption.py
CHANGED
lightly_studio/models/sample.py
CHANGED
|
@@ -10,12 +10,14 @@ from sqlalchemy.orm import Mapped, Session
|
|
|
10
10
|
from sqlmodel import Field, Relationship, SQLModel
|
|
11
11
|
|
|
12
12
|
from lightly_studio.models.annotation.annotation_base import AnnotationView
|
|
13
|
+
from lightly_studio.models.caption import CaptionView
|
|
13
14
|
from lightly_studio.resolvers import metadata_resolver
|
|
14
15
|
|
|
15
16
|
if TYPE_CHECKING:
|
|
16
17
|
from lightly_studio.models.annotation.annotation_base import (
|
|
17
18
|
AnnotationBaseTable,
|
|
18
19
|
)
|
|
20
|
+
from lightly_studio.models.caption import CaptionTable
|
|
19
21
|
from lightly_studio.models.metadata import (
|
|
20
22
|
SampleMetadataTable,
|
|
21
23
|
SampleMetadataView,
|
|
@@ -24,6 +26,7 @@ if TYPE_CHECKING:
|
|
|
24
26
|
from lightly_studio.models.tag import TagTable
|
|
25
27
|
else:
|
|
26
28
|
AnnotationBaseTable = object
|
|
29
|
+
CaptionTable = object
|
|
27
30
|
SampleEmbeddingTable = object
|
|
28
31
|
SampleMetadataTable = object
|
|
29
32
|
TagTable = object
|
|
@@ -91,6 +94,9 @@ class SampleTable(SampleBase, table=True):
|
|
|
91
94
|
annotations: Mapped[List["AnnotationBaseTable"]] = Relationship(
|
|
92
95
|
back_populates="sample",
|
|
93
96
|
)
|
|
97
|
+
captions: Mapped[List["CaptionTable"]] = Relationship(
|
|
98
|
+
back_populates="sample",
|
|
99
|
+
)
|
|
94
100
|
|
|
95
101
|
"""The tag ids associated with the sample."""
|
|
96
102
|
tags: Mapped[List["TagTable"]] = Relationship(
|
|
@@ -171,6 +177,7 @@ class SampleView(SQLModel):
|
|
|
171
177
|
sample_id: UUID
|
|
172
178
|
dataset_id: UUID
|
|
173
179
|
annotations: List["AnnotationView"]
|
|
180
|
+
captions: List[CaptionView] = []
|
|
174
181
|
tags: List[SampleViewTag]
|
|
175
182
|
metadata_dict: Optional["SampleMetadataView"] = None
|
|
176
183
|
width: int
|
|
@@ -40,6 +40,11 @@ class SettingBase(SQLModel):
|
|
|
40
40
|
description="Controls whether to show text labels on annotations",
|
|
41
41
|
)
|
|
42
42
|
|
|
43
|
+
show_sample_filenames: bool = Field(
|
|
44
|
+
default=False,
|
|
45
|
+
description="Controls whether to show sample filenames in the samples grid view",
|
|
46
|
+
)
|
|
47
|
+
|
|
43
48
|
|
|
44
49
|
class SettingView(SettingBase):
|
|
45
50
|
"""View class for Settings model."""
|
|
@@ -229,10 +229,8 @@ def _build_export_query( # noqa: C901
|
|
|
229
229
|
raise ValueError("Invalid include or export filter combination.")
|
|
230
230
|
|
|
231
231
|
|
|
232
|
-
# TODO:
|
|
233
|
-
#
|
|
234
|
-
# https://linear.app/lightly/issue/LIG-6196/figure-out-architecture-follow-up-changes-in-python-package
|
|
235
|
-
# TODO: this should be abstracted to allow different export formats.
|
|
232
|
+
# TODO(Michal, 10/2025): Consider moving the export logic to a separate service.
|
|
233
|
+
# This is a legacy code from the initial implementation of the export feature.
|
|
236
234
|
def export(
|
|
237
235
|
session: Session,
|
|
238
236
|
dataset_id: UUID,
|
|
@@ -109,6 +109,7 @@ def get_all_by_dataset_id( # noqa: PLR0913
|
|
|
109
109
|
joinedload(AnnotationBaseTable.instance_segmentation_details),
|
|
110
110
|
joinedload(AnnotationBaseTable.semantic_segmentation_details),
|
|
111
111
|
),
|
|
112
|
+
selectinload(SampleTable.captions),
|
|
112
113
|
selectinload(SampleTable.tags),
|
|
113
114
|
# Ignore type checker error below as it's a false positive caused by TYPE_CHECKING.
|
|
114
115
|
joinedload(SampleTable.metadata_dict), # type: ignore[arg-type]
|
|
@@ -52,6 +52,9 @@ def set_settings(session: Session, settings: SettingView) -> SettingView:
|
|
|
52
52
|
# Update show annotation text labels
|
|
53
53
|
current_settings.show_annotation_text_labels = settings.show_annotation_text_labels
|
|
54
54
|
|
|
55
|
+
# Update sample filename visibility
|
|
56
|
+
current_settings.show_sample_filenames = settings.show_sample_filenames
|
|
57
|
+
|
|
55
58
|
session.commit()
|
|
56
59
|
session.refresh(current_settings)
|
|
57
60
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Handler for getting 2D embeddings from high-dimensional embeddings."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from lightly_mundig import TwoDimEmbedding # type: ignore[import-untyped]
|
|
6
|
+
|
|
7
|
+
from lightly_studio.dataset.env import LIGHTLY_STUDIO_LICENSE_KEY
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# TODO(Malte, 10/2025): Add the get_twodim_embeddings function here that handles the
|
|
11
|
+
# caching in the DB and calls _calculate_2d_embeddings when needed.
|
|
12
|
+
def _calculate_2d_embeddings(embedding_values: list[list[float]]) -> list[tuple[float, float]]:
|
|
13
|
+
n_samples = len(embedding_values)
|
|
14
|
+
# For 0, 1 or 2 samples we hard-code deterministic coordinates.
|
|
15
|
+
if n_samples == 0:
|
|
16
|
+
return []
|
|
17
|
+
if n_samples == 1:
|
|
18
|
+
return [(0.0, 0.0)]
|
|
19
|
+
if n_samples == 2: # noqa: PLR2004
|
|
20
|
+
return [(0.0, 0.0), (1.0, 1.0)]
|
|
21
|
+
|
|
22
|
+
license_key = LIGHTLY_STUDIO_LICENSE_KEY
|
|
23
|
+
if license_key is None:
|
|
24
|
+
raise ValueError(
|
|
25
|
+
"LIGHTLY_STUDIO_LICENSE_KEY environment variable is not set. "
|
|
26
|
+
"Please set it to your LightlyStudio license key."
|
|
27
|
+
)
|
|
28
|
+
embedding_calculator = TwoDimEmbedding(embedding_values, license_key)
|
|
29
|
+
return embedding_calculator.calculate_2d_embedding() # type: ignore[no-any-return]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Selection package."""
|
|
@@ -81,6 +81,47 @@ class Mundig:
|
|
|
81
81
|
self._check_consistent_input_size(weights_ndarray.shape[0])
|
|
82
82
|
self.mundig.add_weighting_strategy(weights=weights_ndarray, strength=strength)
|
|
83
83
|
|
|
84
|
+
def add_class_balancing(
|
|
85
|
+
self,
|
|
86
|
+
class_distributions: Iterable[Iterable[float]],
|
|
87
|
+
target: Iterable[float],
|
|
88
|
+
strength: float = 1.0,
|
|
89
|
+
) -> None:
|
|
90
|
+
"""Add a class balancing strategy.
|
|
91
|
+
|
|
92
|
+
This strategy aims to select a subset of samples such that the
|
|
93
|
+
distribution of classes in the subset is close to the target
|
|
94
|
+
distribution.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
class_distributions:
|
|
98
|
+
First dimension is over all samples, second one is the distribution per sample over
|
|
99
|
+
the classes.
|
|
100
|
+
target:
|
|
101
|
+
The desired target distribution for the classes in the selected subset of samples.
|
|
102
|
+
The length of the target must match the number of classes in the class
|
|
103
|
+
distributions.
|
|
104
|
+
strength:
|
|
105
|
+
The strength of the balancing strategy.
|
|
106
|
+
"""
|
|
107
|
+
# Convert to ndarray with float32 dtype if not already
|
|
108
|
+
if isinstance(class_distributions, np.ndarray) and class_distributions.dtype == np.float32:
|
|
109
|
+
class_distributions_nparray = class_distributions
|
|
110
|
+
else:
|
|
111
|
+
class_distributions_nparray = np.array(class_distributions, dtype=np.float32)
|
|
112
|
+
self._check_consistent_input_size(class_distributions_nparray.shape[0])
|
|
113
|
+
target_nparray = np.array(target, dtype=np.float32)
|
|
114
|
+
if class_distributions_nparray.shape[1] != target_nparray.shape[0]:
|
|
115
|
+
raise ValueError(
|
|
116
|
+
f"The length of 'target' {target_nparray.shape[0]} doesn't match the width of "
|
|
117
|
+
f"'class_distributions': {class_distributions_nparray.shape[0]}"
|
|
118
|
+
)
|
|
119
|
+
self.mundig.add_balancing_strategy(
|
|
120
|
+
class_distributions=class_distributions_nparray,
|
|
121
|
+
target=target_nparray,
|
|
122
|
+
strength=strength,
|
|
123
|
+
)
|
|
124
|
+
|
|
84
125
|
def _check_consistent_input_size(self, n_input_samples_strategy: int) -> None:
|
|
85
126
|
"""Assert that input samples count is consistent across strategies.
|
|
86
127
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lightly-studio
|
|
3
|
+
Version: 0.4.0
|
|
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
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Requires-Python: <3.13,>=3.8
|
|
15
|
+
Requires-Dist: annotated-types==0.7.0
|
|
16
|
+
Requires-Dist: duckdb-engine<0.17,>=0.15.0
|
|
17
|
+
Requires-Dist: duckdb<1.3,>=1.2.2
|
|
18
|
+
Requires-Dist: environs<12.0.0
|
|
19
|
+
Requires-Dist: eval-type-backport>=0.2.2
|
|
20
|
+
Requires-Dist: fastapi>=0.115.5
|
|
21
|
+
Requires-Dist: faster-coco-eval>=1.6.5
|
|
22
|
+
Requires-Dist: fsspec>=2023.1.0
|
|
23
|
+
Requires-Dist: labelformat>=0.1.7
|
|
24
|
+
Requires-Dist: lightly-mundig==0.1.7
|
|
25
|
+
Requires-Dist: open-clip-torch>=2.20.0
|
|
26
|
+
Requires-Dist: pyarrow>=17.0.0
|
|
27
|
+
Requires-Dist: python-multipart>=0.0.20
|
|
28
|
+
Requires-Dist: scikit-learn==1.3.2
|
|
29
|
+
Requires-Dist: sqlmodel>=0.0.22
|
|
30
|
+
Requires-Dist: tqdm>=4.65.0
|
|
31
|
+
Requires-Dist: typing-extensions>=4.12.2
|
|
32
|
+
Requires-Dist: uvicorn>=0.32.1
|
|
33
|
+
Requires-Dist: xxhash>=3.5.0
|
|
34
|
+
Provides-Extra: cloud-storage
|
|
35
|
+
Requires-Dist: adlfs>=2023.1.0; extra == 'cloud-storage'
|
|
36
|
+
Requires-Dist: gcsfs>=2023.1.0; extra == 'cloud-storage'
|
|
37
|
+
Requires-Dist: s3fs>=2023.1.0; extra == 'cloud-storage'
|
|
38
|
+
Provides-Extra: lightly-edge
|
|
39
|
+
Requires-Dist: lightly-edge-sdk>=1.0.1b2; extra == 'lightly-edge'
|
|
40
|
+
Requires-Dist: opencv-python; extra == 'lightly-edge'
|
|
41
|
+
Description-Content-Type: text/markdown
|
|
42
|
+
|
|
43
|
+
<p align="center">
|
|
44
|
+
<a href="https://lightly.ai/lightly-studio">
|
|
45
|
+
<img src="https://cdn.prod.website-files.com/62cd5ce03261cba217188442/66dac501a8e9a90495970876_Logo%20dark-short-p-800.png" height="50" alt="LightlyStudio logo" />
|
|
46
|
+
</a>
|
|
47
|
+
</p>
|
|
48
|
+
<p align="center"><strong>Curate, Annotate, and Manage Your Data in LightlyStudio.</strong></p>
|
|
49
|
+
<p align="center">
|
|
50
|
+
<a href="https://pypi.org/project/lightly-studio">
|
|
51
|
+
<img src="https://img.shields.io/pypi/pyversions/lightly-studio" alt="PyPI python" />
|
|
52
|
+
</a>
|
|
53
|
+
<a href="https://pypi.org/project/lightly-studio">
|
|
54
|
+
<img src="https://badge.fury.io/py/lightly-studio.svg" alt="PyPI version" />
|
|
55
|
+
</a>
|
|
56
|
+
<a href="LICENSE">
|
|
57
|
+
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License" />
|
|
58
|
+
</a>
|
|
59
|
+
<a href="https://docs.lightly.ai/studio">
|
|
60
|
+
<img src="https://img.shields.io/badge/Docs-blue" alt="Docs" />
|
|
61
|
+
</a>
|
|
62
|
+
</p>
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
# Welcome to LightlyStudio!
|
|
67
|
+
|
|
68
|
+
We at **[Lightly](https://lightly.ai)** created **[LightlyStudio](https://www.lightly.ai/lightly-studio)**, an open-source tool designed to unify your data workflows from curation, annotation and management in a single tool. Since we're big fans of Rust we used it to speed things up. You can work with COCO and ImageNet on a Macbook Pro with M1 and 16GB of memory!
|
|
69
|
+
|
|
70
|
+
Explore [LightlyStudio on GitHub](https://github.com/lightly-ai/lightly-studio).
|
|
71
|
+
|
|
72
|
+
Learn more in our [documentation](https://docs.lightly.ai/studio).
|
|
73
|
+
|
|
74
|
+
<p align="center">
|
|
75
|
+
<img alt="LightlyStudio Overview" src="https://storage.googleapis.com/lightly-public/studio/studio_overview.gif" width="70%">
|
|
76
|
+
<br/>
|
|
77
|
+
<em>Curate, Annotate, and Manage Your Data in LightlyStudio.</em>
|
|
78
|
+
</p>
|