@labelbee/lb-components 1.9.0-alpha.8 → 1.9.1-alpha.0
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.
- package/dist/components/pointCloudView/PointCloudBackView.js +1 -1
- package/dist/components/pointCloudView/PointCloudInfos.js +1 -1
- package/dist/components/pointCloudView/PointCloudSideView.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/assets/predictTracking/icon.svg.js +1 -0
- package/es/assets/predictTracking/icon.svg.js.map +1 -0
- package/es/components/pointCloudView/PointCloudBackView.js +1 -1
- package/es/components/pointCloudView/PointCloudBackView.js.map +1 -1
- package/es/components/pointCloudView/PointCloudInfos.js +1 -1
- package/es/components/pointCloudView/PointCloudInfos.js.map +1 -1
- package/es/components/pointCloudView/PointCloudSideView.js +1 -1
- package/es/components/pointCloudView/PointCloudSideView.js.map +1 -1
- package/es/components/predictTracking/index.js +1 -0
- package/es/components/predictTracking/index.js.map +1 -0
- package/es/components/predictTracking/predictTrackingIcon/index.js +1 -0
- package/es/components/predictTracking/predictTrackingIcon/index.js.map +1 -0
- package/es/components/predictTracking/previewResult/index.js +1 -0
- package/es/components/predictTracking/previewResult/index.js.map +1 -0
- package/es/components/predictTracking/previewResult/util.js +1 -0
- package/es/components/predictTracking/previewResult/util.js.map +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js.map +1 -1
- package/package.json +4 -5
- package/LICENSE +0 -203
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),index=require("./components/EmptyPage/index.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(n,a,r=1)=>{const{width:e,height:t}=a,o={x:n.x+e*r/2,y:n.y+t*r/2},l={x:a.width/2,y:a.height/2};return{offsetX:(l.x-o.x)/r,offsetY:-(l.y-o.y)/r}},updateBackViewByCanvas2D=(n,a,r,e,t)=>{const{offsetX:o,offsetY:l}=TransferCanvas2WorldOffset(n,r,a);if(t.camera.zoom=a,n){const f=Math.cos(e.rotation),C=Math.sin(e.rotation),i=o*f,u=o*C,{x:s,y:c,z:d}=t.initCameraPosition;t.camera.position.set(s+u,c-i,d+l)}t.camera.updateProjectionMatrix(),t.render()},PointCloudSideView=({currentData:n,config:a,checkMode:r})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),t=React.useRef(null),o=useSize(t),{selectedBox:l}=useSingleBox.useSingleBox(),{t:f}=reactI18next.useTranslation(),{backViewUpdateBox:C}=usePointCloudViews.usePointCloudViews();return React.useEffect(()=>{if(t.current){const i={width:t.current.clientWidth,height:t.current.clientHeight},u=new lbAnnotation.PointCloudAnnotation({container:t.current,size:i,polygonOperationProps:{showDirectionLine:!1,forbidAddNew:!0},config:a,checkMode:r});e.setBackViewInstance(u)}},[]),React.useEffect(()=>{if(!o||!e.backViewInstance)return;const{pointCloud2dOperation:i,pointCloudInstance:u}=e.backViewInstance;i.singleOn("renderZoom",(s,c)=>{!e.selectedPointCloudBox||updateBackViewByCanvas2D(c,s,o,e.selectedPointCloudBox,u)}),i.singleOn("dragMove",({currentPos:s,zoom:c})=>{!e.selectedPointCloudBox||updateBackViewByCanvas2D(s,c,o,e.selectedPointCloudBox,u)}),i.singleOn("updatePolygonByDrag",s=>{if(e.selectedIDs.length===1&&s.length===1){const{newPolygon:c,originPolygon:d}=s[0];c&&d&&C(c,d)}})},[e,o]),React.useEffect(()=>{var i;(i=e==null?void 0:e.backViewInstance)==null||i.initSize(o)},[o]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","back-view"),title:f("BackView")
|
|
1
|
+
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),useSingleBox=require("./hooks/useSingleBox.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSize=require("../../hooks/useSize.js"),index=require("./components/EmptyPage/index.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(n,a,r=1)=>{const{width:e,height:t}=a,o={x:n.x+e*r/2,y:n.y+t*r/2},l={x:a.width/2,y:a.height/2};return{offsetX:(l.x-o.x)/r,offsetY:-(l.y-o.y)/r}},updateBackViewByCanvas2D=(n,a,r,e,t)=>{const{offsetX:o,offsetY:l}=TransferCanvas2WorldOffset(n,r,a);if(t.camera.zoom=a,n){const f=Math.cos(e.rotation),C=Math.sin(e.rotation),i=o*f,u=o*C,{x:s,y:c,z:d}=t.initCameraPosition;t.camera.position.set(s+u,c-i,d+l)}t.camera.updateProjectionMatrix(),t.render()},PointCloudSideView=({currentData:n,config:a,checkMode:r})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),t=React.useRef(null),o=useSize(t),{selectedBox:l}=useSingleBox.useSingleBox(),{t:f}=reactI18next.useTranslation(),{backViewUpdateBox:C}=usePointCloudViews.usePointCloudViews();return React.useEffect(()=>{if(t.current){const i={width:t.current.clientWidth,height:t.current.clientHeight},u=new lbAnnotation.PointCloudAnnotation({container:t.current,size:i,polygonOperationProps:{showDirectionLine:!1,forbidAddNew:!0},config:a,checkMode:r});e.setBackViewInstance(u)}},[]),React.useEffect(()=>{if(!o||!e.backViewInstance)return;const{pointCloud2dOperation:i,pointCloudInstance:u}=e.backViewInstance;i.singleOn("renderZoom",(s,c)=>{!e.selectedPointCloudBox||updateBackViewByCanvas2D(c,s,o,e.selectedPointCloudBox,u)}),i.singleOn("dragMove",({currentPos:s,zoom:c})=>{!e.selectedPointCloudBox||updateBackViewByCanvas2D(s,c,o,e.selectedPointCloudBox,u)}),i.singleOn("updatePolygonByDrag",s=>{if(e.selectedIDs.length===1&&s.length===1){const{newPolygon:c,originPolygon:d}=s[0];c&&d&&C(c,d)}})},[e,o]),React.useEffect(()=>{var i;(i=e==null?void 0:e.backViewInstance)==null||i.initSize(o)},[o]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","back-view"),title:f("BackView")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:t}),!l&&React__default.default.createElement(index,null),React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Back})))};var PointCloudBackView=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSideView);module.exports=PointCloudBackView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useSingleBox=require("./hooks/useSingleBox.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const DECIMAL_PLACES=2,SizeInfoForView=({perspectiveView:t})=>{const{pointCloudBoxList:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("./PointCloudContext.js"),lbAnnotation=require("@labelbee/lb-annotation"),useSingleBox=require("./hooks/useSingleBox.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,o)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,__spreadValues=(t,e)=>{for(var o in e||(e={}))__hasOwnProp.call(e,o)&&__defNormalProp(t,o,e[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(e))__propIsEnum.call(e,o)&&__defNormalProp(t,o,e[o]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));const DECIMAL_PLACES=2,DEFAULT_BOX_INFO_STYLE={color:"white",backgroundColor:"rgba(153, 153, 153, 0.3)",padding:"8px 10px",zIndex:20,fontSize:14},SizeInfoForView=({perspectiveView:t})=>{const{pointCloudBoxList:e,selectedID:o}=React__default.default.useContext(PointCloudContext.PointCloudContext),n=e.find(a=>a.id===o),f=reactI18next.useTranslation(),{t:l}=f;if(o&&n){const{length:a,width:i,height:s}=lbUtils.PointCloudUtils.transferBox2Kitti(n),r=t===lbUtils.EPerspectiveView.Back?[{label:l("Width"),value:i},{label:l("Height"),value:s}]:[{label:l("Length"),value:a},{label:l("Height"),value:s}];return React__default.default.createElement("div",{style:__spreadProps(__spreadValues({position:"absolute"},DEFAULT_BOX_INFO_STYLE),{bottom:"4%",left:"50%",transform:"translate(-50%, 0)"})},r.map((u,d)=>React__default.default.createElement("span",{key:d,style:{marginRight:d===0?16:0}},`${u.label}: ${u.value.toFixed(DECIMAL_PLACES)}`)))}return null},BoxInfos=({checkMode:t,config:e})=>{const o=React__default.default.useContext(PointCloudContext.PointCloudContext),{selectedBox:n}=useSingleBox.useSingleBox(),[f,l]=React.useState([]),a=reactI18next.useTranslation(),{t:i,i18n:s}=a;return React.useEffect(()=>{var r;if(!n)return;const{length:u,width:d,height:b,rotation_y:v}=lbUtils.PointCloudUtils.transferBox2Kitti(n.info);let c=[{label:i("Length"),value:u.toFixed(DECIMAL_PLACES)},{label:i("Width"),value:d.toFixed(DECIMAL_PLACES)},{label:i("Height"),value:b.toFixed(DECIMAL_PLACES)},{label:i("Rotation_y"),value:lbAnnotation.UnitUtils.rad2deg(v).toFixed(DECIMAL_PLACES)}];(r=o.mainViewInstance)==null||r.filterPointsByBox(n.info).then(p=>{if(!p){l(c);return}c.push({label:i("PointCount"),value:`${p.num}`}),t===!0&&n.info.subAttribute&&e&&lbUtils.PointCloudUtils.getSubAttributeName(n.info.subAttribute,e).forEach(x=>c.push(x)),l(c)})},[n,s.language]),n?React__default.default.createElement("div",{style:__spreadProps(__spreadValues({position:"absolute"},DEFAULT_BOX_INFO_STYLE),{right:8,bottom:8})},f.map(r=>React__default.default.createElement("div",{key:r.label},`${r.label}: ${r.value}`))):null},PointCloudValidity=()=>{const t=React__default.default.useContext(PointCloudContext.PointCloudContext),{t:e}=reactI18next.useTranslation();return t.valid===!1?React__default.default.createElement("div",{style:{position:"absolute",backgroundColor:"rgb(242, 101, 73)",color:"white",opacity:.7,left:0,top:0,fontSize:30,padding:"8px 16px",zIndex:20,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},e("Invalid")):null};exports.BoxInfos=BoxInfos,exports.PointCloudValidity=PointCloudValidity,exports.SizeInfoForView=SizeInfoForView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),lbUtils=require("@labelbee/lb-utils"),PointCloudContext=require("./PointCloudContext.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSingleBox=require("./hooks/useSingleBox.js"),index=require("./components/EmptyPage/index.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(t,s,e=1)=>{const{width:c,height:r}=s,n={x:t.x+c*e/2,y:t.y+r*e/2},o={x:s.width/2,y:s.height/2};return{offsetX:(o.x-n.x)/e,offsetY:-(o.y-n.y)/e}},updateSideViewByCanvas2D=(t,s,e,c,r)=>{const{offsetX:n,offsetY:o}=TransferCanvas2WorldOffset(t,e,s);if(r.camera.zoom=s,t){const d=Math.cos(c.rotation),i=Math.sin(c.rotation),u=n*d,a=n*i,{x:l,y:f,z:x}=r.initCameraPosition;r.camera.position.set(l-u,f-a,x+o)}r.camera.updateProjectionMatrix(),r.render()},PointCloudSideView=({config:t,checkMode:s})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{sideViewUpdateBox:c}=usePointCloudViews.usePointCloudViews(),{selectedBox:r}=useSingleBox.useSingleBox(),n=React.useRef(null),o=useSize(n),{t:d}=reactI18next.useTranslation();return React.useEffect(()=>{if(n.current){const i={width:n.current.clientWidth,height:n.current.clientHeight},u=new lbAnnotation.PointCloudAnnotation({container:n.current,size:i,polygonOperationProps:{showDirectionLine:!1,forbidAddNew:!0},config:t,checkMode:s});e.setSideViewInstance(u)}},[]),React.useEffect(()=>{if(!o||!e.sideViewInstance)return;const{pointCloud2dOperation:i,pointCloudInstance:u}=e.sideViewInstance;i.singleOn("renderZoom",(a,l)=>{!e.selectedPointCloudBox||updateSideViewByCanvas2D(l,a,o,e.selectedPointCloudBox,u)}),i.singleOn("dragMove",({currentPos:a,zoom:l})=>{!e.selectedPointCloudBox||updateSideViewByCanvas2D(a,l,o,e.selectedPointCloudBox,u)}),i.singleOn("updatePolygonByDrag",a=>{if(e.selectedIDs.length===1&&a.length===1){const{newPolygon:l,originPolygon:f}=a[0];c(l,f)}})},[e,o]),React.useEffect(()=>{var i;(i=e==null?void 0:e.sideViewInstance)==null||i.initSize(o)},[o]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","side-view"),title:d("SideView")
|
|
1
|
+
"use strict";var lbAnnotation=require("@labelbee/lb-annotation"),dom=require("../../utils/dom.js"),PointCloudLayout=require("./PointCloudLayout.js"),React=require("react"),lbUtils=require("@labelbee/lb-utils"),PointCloudContext=require("./PointCloudContext.js"),PointCloudInfos=require("./PointCloudInfos.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),usePointCloudViews=require("./hooks/usePointCloudViews.js"),useSingleBox=require("./hooks/useSingleBox.js"),index=require("./components/EmptyPage/index.js"),useSize=require("../../hooks/useSize.js"),reactI18next=require("react-i18next"),ctx=require("../../store/ctx.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const TransferCanvas2WorldOffset=(t,s,e=1)=>{const{width:c,height:r}=s,n={x:t.x+c*e/2,y:t.y+r*e/2},o={x:s.width/2,y:s.height/2};return{offsetX:(o.x-n.x)/e,offsetY:-(o.y-n.y)/e}},updateSideViewByCanvas2D=(t,s,e,c,r)=>{const{offsetX:n,offsetY:o}=TransferCanvas2WorldOffset(t,e,s);if(r.camera.zoom=s,t){const d=Math.cos(c.rotation),i=Math.sin(c.rotation),u=n*d,a=n*i,{x:l,y:f,z:x}=r.initCameraPosition;r.camera.position.set(l-u,f-a,x+o)}r.camera.updateProjectionMatrix(),r.render()},PointCloudSideView=({config:t,checkMode:s})=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),{sideViewUpdateBox:c}=usePointCloudViews.usePointCloudViews(),{selectedBox:r}=useSingleBox.useSingleBox(),n=React.useRef(null),o=useSize(n),{t:d}=reactI18next.useTranslation();return React.useEffect(()=>{if(n.current){const i={width:n.current.clientWidth,height:n.current.clientHeight},u=new lbAnnotation.PointCloudAnnotation({container:n.current,size:i,polygonOperationProps:{showDirectionLine:!1,forbidAddNew:!0},config:t,checkMode:s});e.setSideViewInstance(u)}},[]),React.useEffect(()=>{if(!o||!e.sideViewInstance)return;const{pointCloud2dOperation:i,pointCloudInstance:u}=e.sideViewInstance;i.singleOn("renderZoom",(a,l)=>{!e.selectedPointCloudBox||updateSideViewByCanvas2D(l,a,o,e.selectedPointCloudBox,u)}),i.singleOn("dragMove",({currentPos:a,zoom:l})=>{!e.selectedPointCloudBox||updateSideViewByCanvas2D(a,l,o,e.selectedPointCloudBox,u)}),i.singleOn("updatePolygonByDrag",a=>{if(e.selectedIDs.length===1&&a.length===1){const{newPolygon:l,originPolygon:f}=a[0];c(l,f)}})},[e,o]),React.useEffect(()=>{var i;(i=e==null?void 0:e.sideViewInstance)==null||i.initSize(o)},[o]),React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:dom.getClassName("point-cloud-container","side-view"),title:d("SideView")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","bottom-view-content")},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","core-instance"),ref:n}),!r&&React__default.default.createElement(index,null),React__default.default.createElement(PointCloudInfos.SizeInfoForView,{perspectiveView:lbUtils.EPerspectiveView.Left})))};var PointCloudSideView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudSideView);module.exports=PointCloudSideView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),icons=require("@ant-design/icons"),ToolIcons=require("../ToolIcons.js"),lbAnnotation=require("@labelbee/lb-annotation"),PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),StepUtils=require("../../../../utils/StepUtils.js"),reactRedux=require("react-redux"),index=require("../../../../utils/index.js"),useStatus=require("../../../../components/pointCloudView/hooks/useStatus.js"),useSingleBox=require("../../../../components/pointCloudView/hooks/useSingleBox.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$1=require("./components/batchUpdateModal/index.js"),lbUtils=require("@labelbee/lb-utils"),index$2=require("../../../../components/attributeList/index.js"),useAttribute=require("../../../../components/pointCloudView/hooks/useAttribute.js");function _interopDefaultLegacy(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var React__default=_interopDefaultLegacy(React);const AnnotatedBox=({imgList:l,imgIndex:i})=>{const s=React.useContext(PointCloudContext.PointCloudContext),[o,c]=React.useState([]),{t:r}=reactI18next.useTranslation();React.useEffect(()=>{const a=l;let t=new Map;c(lbUtils.PointCloudUtils.getAllPointCloudResult({imgList:a,extraBoxList:m,ignoreIndexList:[i]}).filter(n=>!n.trackID||t.get(n.trackID)?!1:(t.set(n.trackID,!0),!0)).sort((n,u)=>{var d,e;const p=(d=n==null?void 0:n.trackID)!=null?d:0,v=(e=u==null?void 0:u.trackID)!=null?e:0;return p-v}).map(n=>{var u;return(u=n==null?void 0:n.trackID)!=null?u:0}))},[s.pointCloudBoxList,l]);const{pointCloudBoxList:m}=s;return React__default.default.createElement("div",{style:{padding:24,borderBottom:"1px solid #eee"}},React__default.default.createElement("div",{style:{marginBottom:16}},r("AllTrackIDs")),React__default.default.createElement("div",null,o.map(a=>React__default.default.createElement(antd.Tag,{color:"#F3F4FF",key:a,style:{color:"#666",marginBottom:8}},a))))},BoxTrackIDInput=()=>{const[l,i]=React.useState(!1),{pointCloudBoxList:s}=React.useContext(PointCloudContext.PointCloudContext),{selectedBox:o,updateSelectedBox:c}=useSingleBox.useSingleBox(),[r,m]=React.useState(""),{t:a}=reactI18next.useTranslation(),t=o==null?void 0:o.info.trackID,n=d=>!!s.find(p=>p.trackID===d&&p.id!==(o==null?void 0:o.info.id)),u=(d=!1)=>{const e=parseInt(r,10);if(d&&i(!1),isNaN(e)){antd.message.error(a("PositiveIntegerCheck"));return}if(r.indexOf(".")>-1){antd.message.error(a("NotAllowDecimalPointsInTrackID"));return}if(n(e)){antd.message.error(a("DuplicateTrackIDsExist"));return}if(!(e>0)){antd.message.error(a("PositiveIntegerCheck"));return}c({trackID:e})};return React.useEffect(()=>{i(!1)},[t]),React__default.default.createElement("div",{style:{padding:24}},React__default.default.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},React__default.default.createElement("span",null,a("CurrentBoxTrackIDs")),t&&React__default.default.createElement(index$1,{id:t})),React__default.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l&&t?React__default.default.createElement(antd.Input,{defaultValue:t,onChange:d=>{m(d.target.value)},disabled:!t,size:"small",onBlur:()=>{u()},onPressEnter:()=>{u(!0)}}):React__default.default.createElement("span",null,t),React__default.default.createElement(icons.EditFilled,{style:{color:"#999",marginLeft:16,cursor:typeof t!="undefined"?"pointer":"not-allowed"},onClick:()=>{t&&i(!l)}})))},AttributeUpdater=({attributeList:l,subAttributeList:i,toolInstance:s})=>{const{selectedBox:o}=useSingleBox.useSingleBox(),c=React.useContext(PointCloudContext.PointCloudContext),{t:r}=reactI18next.useTranslation(),{defaultAttribute:m}=useAttribute.useAttribute(),a={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"},t={margin:"12px 20px 8px",fontSize:14,fontWeight:500,wordWrap:"break-word"},n=e=>{s.setDefaultAttribute(e)},u=(e,p)=>{s.setSubAttribute(e,p)},d=l.map(e=>({label:e.key,value:e.value,color:e==null?void 0:e.color}));return React__default.default.createElement("div",null,React__default.default.createElement("div",{style:a},r("Attribute")),React__default.default.createElement(index$2.default,{list:d,forbidDefault:!0,selectedAttribute:m!=null?m:"",attributeChanged:e=>n(e)}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),o&&React__default.default.createElement(React__default.default.Fragment,null,i.map(e=>{var p,v,x,g,C;return(e==null?void 0:e.subSelected)&&React__default.default.createElement("div",{style:{marginTop:12},key:e.value},React__default.default.createElement("div",{style:t},r("SubAttribute"),"-",e.key),((p=e.subSelected)==null?void 0:p.length)<5?React__default.default.createElement(index$2.default,{list:e.subSelected.map(f=>({label:f.key,value:f.value})),selectedAttribute:(x=(v=c.selectedPointCloudBox)==null?void 0:v.subAttribute)==null?void 0:x[e.value],num:"-",forbidColor:!0,forbidDefault:!0,attributeChanged:f=>u(e.value,f),style:{marginBottom:12}}):React__default.default.createElement(antd.Select,{style:{margin:"0px 21px 17px 16px",width:"87%"},value:(C=(g=c.selectedPointCloudBox)==null?void 0:g.subAttribute)==null?void 0:C[e.value],placeholder:r("PleaseSelect"),onChange:f=>u(e.value,f),allowClear:!0},e.subSelected.map(f=>React__default.default.createElement(antd.Select.Option,{key:f.value,value:f.value},f.key))),React__default.default.createElement(antd.Divider,{style:{margin:0}}))})))},PointCloudToolSidebar=({stepInfo:l,toolInstance:i,imgList:s,imgIndex:o})=>{var c,r;const{updatePointCloudPattern:m,pointCloudPattern:a}=useStatus.useStatus(),t=index.jsonParser(l.config),n=(c=t==null?void 0:t.attributeList)!=null?c:[],u=(t==null?void 0:t.secondaryAttributeConfigurable)===!0?(r=t==null?void 0:t.inputList)!=null?r:[]:[];return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(ToolIcons.ToolIcons,{toolName:lbAnnotation.cTool.EPointCloudName.PointCloud,selectedToolName:a,onChange:d=>m==null?void 0:m(d)}),(t==null?void 0:t.trackConfigurable)===!0&&React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(
|
|
1
|
+
"use strict";var React=require("react"),icons=require("@ant-design/icons"),ToolIcons=require("../ToolIcons.js"),lbAnnotation=require("@labelbee/lb-annotation"),PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),StepUtils=require("../../../../utils/StepUtils.js"),reactRedux=require("react-redux"),index=require("../../../../utils/index.js"),useStatus=require("../../../../components/pointCloudView/hooks/useStatus.js"),useSingleBox=require("../../../../components/pointCloudView/hooks/useSingleBox.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$1=require("./components/batchUpdateModal/index.js"),lbUtils=require("@labelbee/lb-utils"),index$2=require("../../../../components/attributeList/index.js"),useAttribute=require("../../../../components/pointCloudView/hooks/useAttribute.js");function _interopDefaultLegacy(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var React__default=_interopDefaultLegacy(React);const AnnotatedBox=({imgList:l,imgIndex:i})=>{const s=React.useContext(PointCloudContext.PointCloudContext),[o,c]=React.useState([]),{t:r}=reactI18next.useTranslation();React.useEffect(()=>{const a=l;let t=new Map;c(lbUtils.PointCloudUtils.getAllPointCloudResult({imgList:a,extraBoxList:m,ignoreIndexList:[i]}).filter(n=>!n.trackID||t.get(n.trackID)?!1:(t.set(n.trackID,!0),!0)).sort((n,u)=>{var d,e;const p=(d=n==null?void 0:n.trackID)!=null?d:0,v=(e=u==null?void 0:u.trackID)!=null?e:0;return p-v}).map(n=>{var u;return(u=n==null?void 0:n.trackID)!=null?u:0}))},[s.pointCloudBoxList,l]);const{pointCloudBoxList:m}=s;return React__default.default.createElement("div",{style:{padding:24,borderBottom:"1px solid #eee"}},React__default.default.createElement("div",{style:{marginBottom:16}},r("AllTrackIDs")),React__default.default.createElement("div",null,o.map(a=>React__default.default.createElement(antd.Tag,{color:"#F3F4FF",key:a,style:{color:"#666",marginBottom:8}},a))))},BoxTrackIDInput=()=>{const[l,i]=React.useState(!1),{pointCloudBoxList:s}=React.useContext(PointCloudContext.PointCloudContext),{selectedBox:o,updateSelectedBox:c}=useSingleBox.useSingleBox(),[r,m]=React.useState(""),{t:a}=reactI18next.useTranslation(),t=o==null?void 0:o.info.trackID,n=d=>!!s.find(p=>p.trackID===d&&p.id!==(o==null?void 0:o.info.id)),u=(d=!1)=>{const e=parseInt(r,10);if(d&&i(!1),isNaN(e)){antd.message.error(a("PositiveIntegerCheck"));return}if(r.indexOf(".")>-1){antd.message.error(a("NotAllowDecimalPointsInTrackID"));return}if(n(e)){antd.message.error(a("DuplicateTrackIDsExist"));return}if(!(e>0)){antd.message.error(a("PositiveIntegerCheck"));return}c({trackID:e})};return React.useEffect(()=>{i(!1)},[t]),React__default.default.createElement("div",{style:{padding:24}},React__default.default.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},React__default.default.createElement("span",null,a("CurrentBoxTrackIDs")),t&&React__default.default.createElement(index$1,{id:t})),React__default.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l&&t?React__default.default.createElement(antd.Input,{defaultValue:t,onChange:d=>{m(d.target.value)},disabled:!t,size:"small",onBlur:()=>{u()},onPressEnter:()=>{u(!0)}}):React__default.default.createElement("span",null,t),React__default.default.createElement(icons.EditFilled,{style:{color:"#999",marginLeft:16,cursor:typeof t!="undefined"?"pointer":"not-allowed"},onClick:()=>{t&&i(!l)}})))},AttributeUpdater=({attributeList:l,subAttributeList:i,toolInstance:s})=>{const{selectedBox:o}=useSingleBox.useSingleBox(),c=React.useContext(PointCloudContext.PointCloudContext),{t:r}=reactI18next.useTranslation(),{defaultAttribute:m}=useAttribute.useAttribute(),a={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"},t={margin:"12px 20px 8px",fontSize:14,fontWeight:500,wordWrap:"break-word"},n=e=>{s.setDefaultAttribute(e)},u=(e,p)=>{s.setSubAttribute(e,p)},d=l.map(e=>({label:e.key,value:e.value,color:e==null?void 0:e.color}));return React__default.default.createElement("div",null,React__default.default.createElement("div",{style:a},r("Attribute")),React__default.default.createElement(index$2.default,{list:d,forbidDefault:!0,selectedAttribute:m!=null?m:"",attributeChanged:e=>n(e)}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),o&&React__default.default.createElement(React__default.default.Fragment,null,i.map(e=>{var p,v,x,g,C;return(e==null?void 0:e.subSelected)&&React__default.default.createElement("div",{style:{marginTop:12},key:e.value},React__default.default.createElement("div",{style:t},r("SubAttribute"),"-",e.key),((p=e.subSelected)==null?void 0:p.length)<5?React__default.default.createElement(index$2.default,{list:e.subSelected.map(f=>({label:f.key,value:f.value})),selectedAttribute:(x=(v=c.selectedPointCloudBox)==null?void 0:v.subAttribute)==null?void 0:x[e.value],num:"-",forbidColor:!0,forbidDefault:!0,attributeChanged:f=>u(e.value,f),style:{marginBottom:12}}):React__default.default.createElement(antd.Select,{style:{margin:"0px 21px 17px 16px",width:"87%"},value:(C=(g=c.selectedPointCloudBox)==null?void 0:g.subAttribute)==null?void 0:C[e.value],placeholder:r("PleaseSelect"),onChange:f=>u(e.value,f),allowClear:!0},e.subSelected.map(f=>React__default.default.createElement(antd.Select.Option,{key:f.value,value:f.value},f.key))),React__default.default.createElement(antd.Divider,{style:{margin:0}}))})))},PointCloudToolSidebar=({stepInfo:l,toolInstance:i,imgList:s,imgIndex:o})=>{var c,r;const{updatePointCloudPattern:m,pointCloudPattern:a}=useStatus.useStatus(),t=index.jsonParser(l.config),n=(c=t==null?void 0:t.attributeList)!=null?c:[],u=(t==null?void 0:t.secondaryAttributeConfigurable)===!0?(r=t==null?void 0:t.inputList)!=null?r:[]:[];return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(ToolIcons.ToolIcons,{toolName:lbAnnotation.cTool.EPointCloudName.PointCloud,selectedToolName:a,onChange:d=>m==null?void 0:m(d)}),React__default.default.createElement(AttributeUpdater,{toolInstance:i,attributeList:n,subAttributeList:u}),(t==null?void 0:t.trackConfigurable)===!0&&React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(BoxTrackIDInput,null),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(AnnotatedBox,{imgList:s,imgIndex:o})))},mapStateToProps=l=>{var i,s,o;const c=StepUtils.getCurrentStepInfo((i=l.annotation)==null?void 0:i.step,(s=l.annotation)==null?void 0:s.stepList),r=(o=l.annotation)==null?void 0:o.toolInstance;return{stepInfo:c,toolInstance:r,imgList:l.annotation.imgList,imgIndex:l.annotation.imgIndex}};var PointCloudToolSidebar$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudToolSidebar);module.exports=PointCloudToolSidebar$1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='19' height='19' viewBox='0 0 19 19'%3e %3cdefs%3e %3cstyle%3e .cls-1 %7b fill: %23797979%3b stroke: rgba(0%2c0%2c0%2c0)%3b stroke-miterlimit: 10%3b %7d .cls-2 %7b fill: none%3b opacity: 0.3%3b %7d %3c/style%3e %3c/defs%3e %3cg id='icon_buquan' transform='translate(0.501 0.5)'%3e %3cpath id='Clip_2' data-name='Clip 2' class='cls-2' d='M0%2c0H18V18H0Z'/%3e %3cpath id='%e5%87%8f%e5%8e%bb_15' data-name='%e5%87%8f%e5%8e%bb 15' class='cls-1' d='M473.725%2c6954H462.273a1.561%2c1.561%2c0%2c0%2c1-1.159-.529%2c1.88%2c1.88%2c0%2c0%2c1-.48-1.272v-.9h-.815a.809.809%2c0%2c0%2c1-.585-.271.9.9%2c0%2c0%2c1-.236-.6V6947.7a.863.863%2c0%2c0%2c1%2c.819-.9h.817c0-3.474%2c2.569-6.3%2c5.726-6.3h.824v-1.143a1.83%2c1.83%2c0%2c0%2c1-.819-1.557%2c1.914%2c1.914%2c0%2c0%2c1%2c.48-1.274%2c1.532%2c1.532%2c0%2c0%2c1%2c2.312%2c0%2c1.9%2c1.9%2c0%2c0%2c1%2c.48%2c1.272%2c1.836%2c1.836%2c0%2c0%2c1-.817%2c1.559v1.141h.817a6.041%2c6.041%2c0%2c0%2c1%2c5.726%2c6.3h.819a.862.862%2c0%2c0%2c1%2c.817.9v2.733a.916.916%2c0%2c0%2c1-.234.6.809.809%2c0%2c0%2c1-.585.271h-.819v.9a1.879%2c1.879%2c0%2c0%2c1-.48%2c1.272A1.578%2c1.578%2c0%2c0%2c1%2c473.725%2c6954ZM471%2c6946a1%2c1%2c0%2c0%2c0-1%2c1v1a1%2c1%2c0%2c1%2c0%2c2%2c0v-1A1%2c1%2c0%2c0%2c0%2c471%2c6946Zm-6%2c0a1%2c1%2c0%2c0%2c0-1%2c1v1a1%2c1%2c0%2c1%2c0%2c2%2c0v-1A1%2c1%2c0%2c0%2c0%2c465%2c6946Z' transform='translate(-459 -6936)'/%3e %3c/g%3e%3c/svg%3e";export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.svg.js","sources":["../../../src/assets/predictTracking/icon.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='19' height='19' viewBox='0 0 19 19'%3e %3cdefs%3e %3cstyle%3e .cls-1 %7b fill: %23797979%3b stroke: rgba(0%2c0%2c0%2c0)%3b stroke-miterlimit: 10%3b %7d .cls-2 %7b fill: none%3b opacity: 0.3%3b %7d %3c/style%3e %3c/defs%3e %3cg id='icon_buquan' transform='translate(0.501 0.5)'%3e %3cpath id='Clip_2' data-name='Clip 2' class='cls-2' d='M0%2c0H18V18H0Z'/%3e %3cpath id='%e5%87%8f%e5%8e%bb_15' data-name='%e5%87%8f%e5%8e%bb 15' class='cls-1' d='M473.725%2c6954H462.273a1.561%2c1.561%2c0%2c0%2c1-1.159-.529%2c1.88%2c1.88%2c0%2c0%2c1-.48-1.272v-.9h-.815a.809.809%2c0%2c0%2c1-.585-.271.9.9%2c0%2c0%2c1-.236-.6V6947.7a.863.863%2c0%2c0%2c1%2c.819-.9h.817c0-3.474%2c2.569-6.3%2c5.726-6.3h.824v-1.143a1.83%2c1.83%2c0%2c0%2c1-.819-1.557%2c1.914%2c1.914%2c0%2c0%2c1%2c.48-1.274%2c1.532%2c1.532%2c0%2c0%2c1%2c2.312%2c0%2c1.9%2c1.9%2c0%2c0%2c1%2c.48%2c1.272%2c1.836%2c1.836%2c0%2c0%2c1-.817%2c1.559v1.141h.817a6.041%2c6.041%2c0%2c0%2c1%2c5.726%2c6.3h.819a.862.862%2c0%2c0%2c1%2c.817.9v2.733a.916.916%2c0%2c0%2c1-.234.6.809.809%2c0%2c0%2c1-.585.271h-.819v.9a1.879%2c1.879%2c0%2c0%2c1-.48%2c1.272A1.578%2c1.578%2c0%2c0%2c1%2c473.725%2c6954ZM471%2c6946a1%2c1%2c0%2c0%2c0-1%2c1v1a1%2c1%2c0%2c1%2c0%2c2%2c0v-1A1%2c1%2c0%2c0%2c0%2c471%2c6946Zm-6%2c0a1%2c1%2c0%2c0%2c0-1%2c1v1a1%2c1%2c0%2c1%2c0%2c2%2c0v-1A1%2c1%2c0%2c0%2c0%2c465%2c6946Z' transform='translate(-459 -6936)'/%3e %3c/g%3e%3c/svg%3e\";\n export default img;"],"names":[],"mappings":"AAAG,IAAC,GAAG,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudAnnotation as g}from"@labelbee/lb-annotation";import{getClassName as C}from"../../utils/dom.js";import{PointCloudContainer as P}from"./PointCloudLayout.js";import d,{useRef as h,useEffect as w}from"react";import{PointCloudContext as y}from"./PointCloudContext.js";import{EPerspectiveView as B}from"@labelbee/lb-utils";import{useSingleBox as v}from"./hooks/useSingleBox.js";import{SizeInfoForView as V}from"./PointCloudInfos.js";import{connect as b}from"react-redux";import{a2MapStateToProps as j}from"../../store/annotation/map.js";import{usePointCloudViews as k}from"./hooks/usePointCloudViews.js";import E from"../../hooks/useSize.js";import I from"./components/EmptyPage/index.js";import{useTranslation as S}from"react-i18next";import{LabelBeeContext as O}from"../../store/ctx.js";const D=(c,i,
|
|
1
|
+
import{PointCloudAnnotation as g}from"@labelbee/lb-annotation";import{getClassName as C}from"../../utils/dom.js";import{PointCloudContainer as P}from"./PointCloudLayout.js";import d,{useRef as h,useEffect as w}from"react";import{PointCloudContext as y}from"./PointCloudContext.js";import{EPerspectiveView as B}from"@labelbee/lb-utils";import{useSingleBox as v}from"./hooks/useSingleBox.js";import{SizeInfoForView as V}from"./PointCloudInfos.js";import{connect as b}from"react-redux";import{a2MapStateToProps as j}from"../../store/annotation/map.js";import{usePointCloudViews as k}from"./hooks/usePointCloudViews.js";import E from"../../hooks/useSize.js";import I from"./components/EmptyPage/index.js";import{useTranslation as S}from"react-i18next";import{LabelBeeContext as O}from"../../store/ctx.js";const D=(c,i,s=1)=>{const{width:t,height:e}=i,o={x:c.x+t*s/2,y:c.y+e*s/2},l={x:i.width/2,y:i.height/2};return{offsetX:(l.x-o.x)/s,offsetY:-(l.y-o.y)/s}},x=(c,i,s,t,e)=>{const{offsetX:o,offsetY:l}=D(c,s,i);if(e.camera.zoom=i,c){const f=Math.cos(t.rotation),p=Math.sin(t.rotation),n=o*f,u=o*p,{x:r,y:a,z:m}=e.initCameraPosition;e.camera.position.set(r+u,a-n,m+l)}e.camera.updateProjectionMatrix(),e.render()},M=({currentData:c,config:i,checkMode:s})=>{const t=d.useContext(y),e=h(null),o=E(e),{selectedBox:l}=v(),{t:f}=S(),{backViewUpdateBox:p}=k();return w(()=>{if(e.current){const n={width:e.current.clientWidth,height:e.current.clientHeight},u=new g({container:e.current,size:n,polygonOperationProps:{showDirectionLine:!1,forbidAddNew:!0},config:i,checkMode:s});t.setBackViewInstance(u)}},[]),w(()=>{if(!o||!t.backViewInstance)return;const{pointCloud2dOperation:n,pointCloudInstance:u}=t.backViewInstance;n.singleOn("renderZoom",(r,a)=>{!t.selectedPointCloudBox||x(a,r,o,t.selectedPointCloudBox,u)}),n.singleOn("dragMove",({currentPos:r,zoom:a})=>{!t.selectedPointCloudBox||x(r,a,o,t.selectedPointCloudBox,u)}),n.singleOn("updatePolygonByDrag",r=>{if(t.selectedIDs.length===1&&r.length===1){const{newPolygon:a,originPolygon:m}=r[0];a&&m&&p(a,m)}})},[t,o]),w(()=>{var n;(n=t==null?void 0:t.backViewInstance)==null||n.initSize(o)},[o]),d.createElement(P,{className:C("point-cloud-container","back-view"),title:f("BackView")},d.createElement("div",{className:C("point-cloud-container","bottom-view-content")},d.createElement("div",{className:C("point-cloud-container","core-instance"),ref:e}),!l&&d.createElement(I,null),d.createElement(V,{perspectiveView:B.Back})))};var N=b(j,null,null,{context:O})(M);export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointCloudBackView.js","sources":["../../../src/components/pointCloudView/PointCloudBackView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-22 11:08:31\n * @LastEditors: Laoluo luozefeng@sensetime.com\n * @LastEditTime: 2022-07-08 11:08:02\n */\nimport { PointCloud, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport { getClassName } from '@/utils/dom';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport React, { useEffect, useRef } from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { EPerspectiveView, IPointCloudBox, UpdatePolygonByDragList } from '@labelbee/lb-utils';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { SizeInfoForView } from './PointCloudInfos';\nimport { connect } from 'react-redux';\nimport { a2MapStateToProps, IA2MapStateProps } from '@/store/annotation/map';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport useSize from '@/hooks/useSize';\nimport EmptyPage from './components/EmptyPage';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\n/**\n * 统一一下,将其拓展为 二维转换为 三维坐标的转换\n * Get the offset from canvas2d-coordinate to world coordinate\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2,\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\nconst updateBackViewByCanvas2D = (\n currentPos: { x: number; y: number },\n zoom: number,\n size: { width: number; height: number },\n selectedPointCloudBox: IPointCloudBox,\n backPointCloud: PointCloud,\n) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n backPointCloud.camera.zoom = zoom;\n if (currentPos) {\n const cos = Math.cos(selectedPointCloudBox.rotation);\n const sin = Math.sin(selectedPointCloudBox.rotation);\n const offsetXX = offsetX * cos;\n const offsetXY = offsetX * sin;\n const { x, y, z } = backPointCloud.initCameraPosition;\n backPointCloud.camera.position.set(x + offsetXY, y - offsetXX, z + offsetY);\n }\n backPointCloud.camera.updateProjectionMatrix();\n backPointCloud.render();\n};\n\ninterface IProps {\n checkMode?: boolean;\n}\n\nconst PointCloudSideView = ({ currentData, config, checkMode }: IA2MapStateProps & IProps) => {\n const ptCtx = React.useContext(PointCloudContext);\n const ref = useRef<HTMLDivElement>(null);\n const size = useSize(ref);\n const { selectedBox } = useSingleBox();\n const { t } = useTranslation();\n const { backViewUpdateBox } = usePointCloudViews();\n\n useEffect(() => {\n if (ref.current) {\n const size = {\n width: ref.current.clientWidth,\n height: ref.current.clientHeight,\n };\n\n const pointCloudAnnotation = new PointCloudAnnotation({\n container: ref.current,\n size,\n polygonOperationProps: { showDirectionLine: false, forbidAddNew: true },\n config,\n checkMode,\n });\n ptCtx.setBackViewInstance(pointCloudAnnotation);\n }\n }, []);\n\n useEffect(() => {\n // By the way as an initialization judgment\n if (!size || !ptCtx.backViewInstance) {\n return;\n }\n\n const {\n pointCloud2dOperation: backPointCloudPolygonOperation,\n pointCloudInstance: backPointCloud,\n } = ptCtx.backViewInstance;\n\n /**\n * Synchronized 3d point cloud view displacement operations\n *\n * Change Orthographic Camera size\n */\n backPointCloudPolygonOperation.singleOn('renderZoom', (zoom: number, currentPos: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateBackViewByCanvas2D(currentPos, zoom, size, ptCtx.selectedPointCloudBox, backPointCloud);\n });\n\n // Synchronized 3d point cloud view displacement operations\n backPointCloudPolygonOperation.singleOn('dragMove', ({ currentPos, zoom }: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateBackViewByCanvas2D(currentPos, zoom, size, ptCtx.selectedPointCloudBox, backPointCloud);\n });\n\n backPointCloudPolygonOperation.singleOn(\n 'updatePolygonByDrag',\n (updateList: UpdatePolygonByDragList) => {\n if (ptCtx.selectedIDs.length === 1 && updateList.length === 1) {\n const { newPolygon, originPolygon } = updateList[0];\n\n if (newPolygon && originPolygon) {\n backViewUpdateBox(newPolygon, originPolygon);\n }\n }\n },\n );\n }, [ptCtx, size]);\n\n useEffect(() => {\n // Update Size\n ptCtx?.backViewInstance?.initSize(size);\n }, [size]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-container', 'back-view')}\n title={t('BackView')}\n
|
|
1
|
+
{"version":3,"file":"PointCloudBackView.js","sources":["../../../src/components/pointCloudView/PointCloudBackView.tsx"],"sourcesContent":["/*\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-06-22 11:08:31\n * @LastEditors: Laoluo luozefeng@sensetime.com\n * @LastEditTime: 2022-07-08 11:08:02\n */\nimport { PointCloud, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport { getClassName } from '@/utils/dom';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport React, { useEffect, useRef } from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { EPerspectiveView, IPointCloudBox, UpdatePolygonByDragList } from '@labelbee/lb-utils';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { SizeInfoForView } from './PointCloudInfos';\nimport { connect } from 'react-redux';\nimport { a2MapStateToProps, IA2MapStateProps } from '@/store/annotation/map';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport useSize from '@/hooks/useSize';\nimport EmptyPage from './components/EmptyPage';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\n/**\n * 统一一下,将其拓展为 二维转换为 三维坐标的转换\n * Get the offset from canvas2d-coordinate to world coordinate\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2,\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\nconst updateBackViewByCanvas2D = (\n currentPos: { x: number; y: number },\n zoom: number,\n size: { width: number; height: number },\n selectedPointCloudBox: IPointCloudBox,\n backPointCloud: PointCloud,\n) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n backPointCloud.camera.zoom = zoom;\n if (currentPos) {\n const cos = Math.cos(selectedPointCloudBox.rotation);\n const sin = Math.sin(selectedPointCloudBox.rotation);\n const offsetXX = offsetX * cos;\n const offsetXY = offsetX * sin;\n const { x, y, z } = backPointCloud.initCameraPosition;\n backPointCloud.camera.position.set(x + offsetXY, y - offsetXX, z + offsetY);\n }\n backPointCloud.camera.updateProjectionMatrix();\n backPointCloud.render();\n};\n\ninterface IProps {\n checkMode?: boolean;\n}\n\nconst PointCloudSideView = ({ currentData, config, checkMode }: IA2MapStateProps & IProps) => {\n const ptCtx = React.useContext(PointCloudContext);\n const ref = useRef<HTMLDivElement>(null);\n const size = useSize(ref);\n const { selectedBox } = useSingleBox();\n const { t } = useTranslation();\n const { backViewUpdateBox } = usePointCloudViews();\n\n useEffect(() => {\n if (ref.current) {\n const size = {\n width: ref.current.clientWidth,\n height: ref.current.clientHeight,\n };\n\n const pointCloudAnnotation = new PointCloudAnnotation({\n container: ref.current,\n size,\n polygonOperationProps: { showDirectionLine: false, forbidAddNew: true },\n config,\n checkMode,\n });\n ptCtx.setBackViewInstance(pointCloudAnnotation);\n }\n }, []);\n\n useEffect(() => {\n // By the way as an initialization judgment\n if (!size || !ptCtx.backViewInstance) {\n return;\n }\n\n const {\n pointCloud2dOperation: backPointCloudPolygonOperation,\n pointCloudInstance: backPointCloud,\n } = ptCtx.backViewInstance;\n\n /**\n * Synchronized 3d point cloud view displacement operations\n *\n * Change Orthographic Camera size\n */\n backPointCloudPolygonOperation.singleOn('renderZoom', (zoom: number, currentPos: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateBackViewByCanvas2D(currentPos, zoom, size, ptCtx.selectedPointCloudBox, backPointCloud);\n });\n\n // Synchronized 3d point cloud view displacement operations\n backPointCloudPolygonOperation.singleOn('dragMove', ({ currentPos, zoom }: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateBackViewByCanvas2D(currentPos, zoom, size, ptCtx.selectedPointCloudBox, backPointCloud);\n });\n\n backPointCloudPolygonOperation.singleOn(\n 'updatePolygonByDrag',\n (updateList: UpdatePolygonByDragList) => {\n if (ptCtx.selectedIDs.length === 1 && updateList.length === 1) {\n const { newPolygon, originPolygon } = updateList[0];\n\n if (newPolygon && originPolygon) {\n backViewUpdateBox(newPolygon, originPolygon);\n }\n }\n },\n );\n }, [ptCtx, size]);\n\n useEffect(() => {\n // Update Size\n ptCtx?.backViewInstance?.initSize(size);\n }, [size]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-container', 'back-view')}\n title={t('BackView')}\n >\n <div className={getClassName('point-cloud-container', 'bottom-view-content')}>\n <div className={getClassName('point-cloud-container', 'core-instance')} ref={ref} />\n {!selectedBox && <EmptyPage />}\n <SizeInfoForView perspectiveView={EPerspectiveView.Back} />\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(a2MapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudSideView,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA8BA,MAAM,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erspectiveView as I}from"@labelbee/lb-utils";import i,{useState as B,useEffect as S}from"react";import{PointCloudContext as g}from"./PointCloudContext.js";import{UnitUtils as L}from"@labelbee/lb-annotation";import{useSingleBox as A}from"./hooks/useSingleBox.js";import{useTranslation as v}from"react-i18next";var F=Object.defineProperty,j=Object.defineProperties,z=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,_=(e,t,o)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,y=(e,t)=>{for(var o in t||(t={}))D.call(t,o)&&_(e,o,t[o]);if(x)for(var o of x(t))N.call(t,o)&&_(e,o,t[o]);return e},P=(e,t)=>j(e,z(t));const u=2,C={color:"white",backgroundColor:"rgba(153, 153, 153, 0.3)",padding:"8px 10px",zIndex:20,fontSize:14},V=({perspectiveView:e})=>{const{pointCloudBoxList:t,selectedID:o}=i.useContext(g),n=t.find(s=>s.id===o),b=v(),{t:l}=b;if(o&&n){const{length:s,width:a,height:c}=m.transferBox2Kitti(n),r=e===I.Back?[{label:l("Width"),value:a},{label:l("Height"),value:c}]:[{label:l("Length"),value:s},{label:l("Height"),value:c}];return i.createElement("div",{style:P(y({position:"absolute"},C),{bottom:"4%",left:"50%",transform:"translate(-50%, 0)"})},r.map((p,f)=>i.createElement("span",{key:f,style:{marginRight:f===0?16:0}},`${p.label}: ${p.value.toFixed(u)}`)))}return null},$=({checkMode:e,config:t})=>{const o=i.useContext(g),{selectedBox:n}=A(),[b,l]=B([]),s=v(),{t:a,i18n:c}=s;return S(()=>{var r;if(!n)return;const{length:p,width:f,height:w,rotation_y:E}=m.transferBox2Kitti(n.info);let d=[{label:a("Length"),value:p.toFixed(u)},{label:a("Width"),value:f.toFixed(u)},{label:a("Height"),value:w.toFixed(u)},{label:a("Rotation_y"),value:L.rad2deg(E).toFixed(u)}];(r=o.mainViewInstance)==null||r.filterPointsByBox(n.info).then(h=>{if(!h){l(d);return}d.push({label:a("PointCount"),value:`${h.num}`}),e===!0&&n.info.subAttribute&&t&&m.getSubAttributeName(n.info.subAttribute,t).forEach(O=>d.push(O)),l(d)})},[n,c.language]),n?i.createElement("div",{style:P(y({position:"absolute"},C),{right:8,bottom:8})},b.map(r=>i.createElement("div",{key:r.label},`${r.label}: ${r.value}`))):null},k=()=>{const e=i.useContext(g),{t}=v();return e.valid===!1?i.createElement("div",{style:{position:"absolute",backgroundColor:"rgb(242, 101, 73)",color:"white",opacity:.7,left:0,top:0,fontSize:30,padding:"8px 16px",zIndex:20,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},t("Invalid")):null};export{$ as BoxInfos,k as PointCloudValidity,V as SizeInfoForView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointCloudInfos.js","sources":["../../../src/components/pointCloudView/PointCloudInfos.tsx"],"sourcesContent":["/**\n * @author Glenfiddish <edwinlee0927@hotmail.com>\n * @file Display selected box's infos\n * @createdate 2022-07-13\n */\n\nimport { EPerspectiveView, IPointCloudConfig, PointCloudUtils } from '@labelbee/lb-utils';\nimport React, { useEffect, useState } from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { UnitUtils } from '@labelbee/lb-annotation';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { useTranslation } from 'react-i18next';\n\nconst DECIMAL_PLACES = 2;\n\n/**\n * Display size info for views\n * @param param0\n * @returns\n */\nexport const SizeInfoForView = ({ perspectiveView }: { perspectiveView: EPerspectiveView }) => {\n const { pointCloudBoxList, selectedID } = React.useContext(PointCloudContext);\n const box = pointCloudBoxList.find((i) => i.id === selectedID);\n const trans = useTranslation();\n const { t } = trans;\n\n if (selectedID && box) {\n const { length, width, height } = PointCloudUtils.transferBox2Kitti(box);\n const infos =\n perspectiveView === EPerspectiveView.Back\n ? [\n {\n label: t('Width'),\n value: width,\n },\n {\n label: t('Height'),\n value: height,\n },\n ]\n : [\n {\n label: t('Length'),\n value: length,\n },\n {\n label: t('Height'),\n value: height,\n },\n ];\n\n return (\n
|
|
1
|
+
{"version":3,"file":"PointCloudInfos.js","sources":["../../../src/components/pointCloudView/PointCloudInfos.tsx"],"sourcesContent":["/**\n * @author Glenfiddish <edwinlee0927@hotmail.com>\n * @file Display selected box's infos\n * @createdate 2022-07-13\n */\n\nimport { EPerspectiveView, IPointCloudConfig, PointCloudUtils } from '@labelbee/lb-utils';\nimport React, { useEffect, useState } from 'react';\nimport { PointCloudContext } from './PointCloudContext';\nimport { UnitUtils } from '@labelbee/lb-annotation';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport { useTranslation } from 'react-i18next';\n\nconst DECIMAL_PLACES = 2;\n\nconst DEFAULT_BOX_INFO_STYLE = {\n color: 'white',\n backgroundColor: 'rgba(153, 153, 153, 0.3)',\n padding: '8px 10px',\n zIndex: 20,\n fontSize: 14,\n};\n\n/**\n * Display size info for views\n * @param param0\n * @returns\n */\nexport const SizeInfoForView = ({ perspectiveView }: { perspectiveView: EPerspectiveView }) => {\n const { pointCloudBoxList, selectedID } = React.useContext(PointCloudContext);\n const box = pointCloudBoxList.find((i) => i.id === selectedID);\n const trans = useTranslation();\n const { t } = trans;\n\n if (selectedID && box) {\n const { length, width, height } = PointCloudUtils.transferBox2Kitti(box);\n const infos =\n perspectiveView === EPerspectiveView.Back\n ? [\n {\n label: t('Width'),\n value: width,\n },\n {\n label: t('Height'),\n value: height,\n },\n ]\n : [\n {\n label: t('Length'),\n value: length,\n },\n {\n label: t('Height'),\n value: height,\n },\n ];\n\n return (\n <div\n style={{\n position: 'absolute',\n ...DEFAULT_BOX_INFO_STYLE,\n bottom: '4%',\n left: '50%',\n transform: 'translate(-50%, 0)',\n }}\n >\n {infos.map((info, index) => (\n <span key={index} style={{ marginRight: index === 0 ? 16 : 0 }}>{`${\n info.label\n }: ${info.value.toFixed(DECIMAL_PLACES)}`}</span>\n ))}\n </div>\n );\n }\n return null;\n};\n\n/**\n * Display selected box's infos\n */\nexport const BoxInfos = ({\n checkMode,\n config,\n}: {\n checkMode?: boolean;\n config: IPointCloudConfig;\n}) => {\n const ptCtx = React.useContext(PointCloudContext);\n const { selectedBox } = useSingleBox();\n const [infos, setInfos] = useState<Array<{ label: string; value: string }>>([]);\n const trans = useTranslation();\n const { t, i18n } = trans;\n\n useEffect(() => {\n if (!selectedBox) {\n return;\n }\n\n const { length, width, height, rotation_y } = PointCloudUtils.transferBox2Kitti(\n selectedBox.info,\n );\n\n let infos = [\n {\n label: t('Length'),\n value: length.toFixed(DECIMAL_PLACES),\n },\n {\n label: t('Width'),\n value: width.toFixed(DECIMAL_PLACES),\n },\n {\n label: t('Height'),\n value: height.toFixed(DECIMAL_PLACES),\n },\n {\n label: t('Rotation_y'),\n value: UnitUtils.rad2deg(rotation_y).toFixed(DECIMAL_PLACES),\n },\n ];\n\n // Get Point Count.\n ptCtx.mainViewInstance?.filterPointsByBox(selectedBox.info).then((data) => {\n if (!data) {\n setInfos(infos);\n return;\n }\n\n infos.push({\n label: t('PointCount'),\n value: `${data.num}`,\n });\n\n // SubAttribute is shown in checkMode\n if (checkMode === true && selectedBox.info.subAttribute && config) {\n const subAttributeNameList = PointCloudUtils.getSubAttributeName(\n selectedBox.info.subAttribute,\n config,\n );\n subAttributeNameList.forEach((data) => infos.push(data));\n }\n\n setInfos(infos);\n });\n }, [selectedBox, i18n.language]);\n\n if (selectedBox) {\n return (\n <div\n style={{\n position: 'absolute',\n ...DEFAULT_BOX_INFO_STYLE,\n right: 8,\n bottom: 8,\n }}\n >\n {infos.map((i) => (\n <div key={i.label}>{`${i.label}: ${i.value}`}</div>\n ))}\n </div>\n );\n }\n\n return null;\n};\n\nexport const PointCloudValidity = () => {\n const ptCtx = React.useContext(PointCloudContext);\n const { t } = useTranslation();\n\n if (ptCtx.valid === false) {\n return (\n <div\n style={{\n position: 'absolute',\n backgroundColor: 'rgb(242, 101, 73)',\n color: 'white',\n opacity: 0.7,\n left: 0,\n top: 0,\n fontSize: 30,\n padding: '8px 16px',\n zIndex: 20,\n width: '100%',\n height: '100%',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n {t('Invalid')}\n </div>\n );\n }\n return null;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,cAAiB,GAAA,CAAA,CAAA;AAEvB,MAAM,sBAAyB,GAAA;AAAA,EAC7B,KAAO,EAAA,OAAA;AAAA,EACP,eAAiB,EAAA,0BAAA;AAAA,EACjB,OAAS,EAAA,UAAA;AAAA,EACT,MAAQ,EAAA,EAAA;AAAA,EACR,QAAU,EAAA,EAAA;AAAA,CAAA,CAAA;AAQC,MAAA,eAAA,GAAkB,CAAC,CAAE,eAA6D,CAAA,KAAA;AAC7F,EAAA,MAAM,CAAE,iBAAA,EAAmB,UAAe,CAAA,GAAA,KAAA,CAAM,UAAW,CAAA,iBAAA,CAAA,CAAA;AAC3D,EAAA,MAAM,MAAM,iBAAkB,CAAA,IAAA,CAAK,CAAC,CAAA,KAAM,EAAE,EAAO,KAAA,UAAA,CAAA,CAAA;AACnD,EAAA,MAAM,KAAQ,GAAA,cAAA,EAAA,CAAA;AACd,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,KAAA,CAAA;AAEd,EAAA,IAAI,cAAc,GAAK,EAAA;AACrB,IAAA,MAAM,CAAE,MAAA,EAAQ,KAAO,EAAA,MAAA,CAAA,GAAW,gBAAgB,iBAAkB,CAAA,GAAA,CAAA,CAAA;AACpE,IAAM,MAAA,KAAA,GACJ,eAAoB,KAAA,gBAAA,CAAiB,IACjC,GAAA;AAAA,MACE;AAAA,QACE,OAAO,CAAE,CAAA,OAAA,CAAA;AAAA,QACT,KAAO,EAAA,KAAA;AAAA,OAAA;AAAA,MAET;AAAA,QACE,OAAO,CAAE,CAAA,QAAA,CAAA;AAAA,QACT,KAAO,EAAA,MAAA;AAAA,OAAA;AAAA,KAGX,GAAA;AAAA,MACE;AAAA,QACE,OAAO,CAAE,CAAA,QAAA,CAAA;A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QACL,QAAU,EAAA,UAAA;AAAA,QACV,eAAiB,EAAA,mBAAA;AAAA,QACjB,KAAO,EAAA,OAAA;AAAA,QACP,OAAS,EAAA,GAAA;AAAA,QACT,IAAM,EAAA,CAAA;AAAA,QACN,GAAK,EAAA,CAAA;AAAA,QACL,QAAU,EAAA,EAAA;AAAA,QACV,OAAS,EAAA,UAAA;AAAA,QACT,MAAQ,EAAA,EAAA;AAAA,QACR,KAAO,EAAA,MAAA;AAAA,QACP,MAAQ,EAAA,MAAA;AAAA,QACR,OAAS,EAAA,MAAA;AAAA,QACT,cAAgB,EAAA,QAAA;AAAA,QAChB,UAAY,EAAA,QAAA;AAAA,OAAA;AAAA,KAAA,EAGb,CAAE,CAAA,SAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAIT,EAAO,OAAA,IAAA,CAAA;AAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PointCloudAnnotation as g}from"@labelbee/lb-annotation";import{getClassName as p}from"../../utils/dom.js";import{PointCloudContainer as h}from"./PointCloudLayout.js";import m,{useRef as P,useEffect as w}from"react";import{EPerspectiveView as y}from"@labelbee/lb-utils";import{PointCloudContext as v}from"./PointCloudContext.js";import{SizeInfoForView as V}from"./PointCloudInfos.js";import{connect as j}from"react-redux";import{a2MapStateToProps as
|
|
1
|
+
import{PointCloudAnnotation as g}from"@labelbee/lb-annotation";import{getClassName as p}from"../../utils/dom.js";import{PointCloudContainer as h}from"./PointCloudLayout.js";import m,{useRef as P,useEffect as w}from"react";import{EPerspectiveView as y}from"@labelbee/lb-utils";import{PointCloudContext as v}from"./PointCloudContext.js";import{SizeInfoForView as V}from"./PointCloudInfos.js";import{connect as j}from"react-redux";import{a2MapStateToProps as B}from"../../store/annotation/map.js";import{usePointCloudViews as b}from"./hooks/usePointCloudViews.js";import{useSingleBox as E}from"./hooks/useSingleBox.js";import I from"./components/EmptyPage/index.js";import S from"../../hooks/useSize.js";import{useTranslation as O}from"react-i18next";import{LabelBeeContext as M}from"../../store/ctx.js";const N=(a,s,e=1)=>{const{width:l,height:i}=s,t={x:a.x+l*e/2,y:a.y+i*e/2},o={x:s.width/2,y:s.height/2};return{offsetX:(o.x-t.x)/e,offsetY:-(o.y-t.y)/e}},x=(a,s,e,l,i)=>{const{offsetX:t,offsetY:o}=N(a,e,s);if(i.camera.zoom=s,a){const f=Math.cos(l.rotation),n=Math.sin(l.rotation),d=t*f,r=t*n,{x:c,y:u,z:C}=i.initCameraPosition;i.camera.position.set(c-d,u-r,C+o)}i.camera.updateProjectionMatrix(),i.render()},X=({config:a,checkMode:s})=>{const e=m.useContext(v),{sideViewUpdateBox:l}=b(),{selectedBox:i}=E(),t=P(null),o=S(t),{t:f}=O();return w(()=>{if(t.current){const n={width:t.current.clientWidth,height:t.current.clientHeight},d=new g({container:t.current,size:n,polygonOperationProps:{showDirectionLine:!1,forbidAddNew:!0},config:a,checkMode:s});e.setSideViewInstance(d)}},[]),w(()=>{if(!o||!e.sideViewInstance)return;const{pointCloud2dOperation:n,pointCloudInstance:d}=e.sideViewInstance;n.singleOn("renderZoom",(r,c)=>{!e.selectedPointCloudBox||x(c,r,o,e.selectedPointCloudBox,d)}),n.singleOn("dragMove",({currentPos:r,zoom:c})=>{!e.selectedPointCloudBox||x(r,c,o,e.selectedPointCloudBox,d)}),n.singleOn("updatePolygonByDrag",r=>{if(e.selectedIDs.length===1&&r.length===1){const{newPolygon:c,originPolygon:u}=r[0];l(c,u)}})},[e,o]),w(()=>{var n;(n=e==null?void 0:e.sideViewInstance)==null||n.initSize(o)},[o]),m.createElement(h,{className:p("point-cloud-container","side-view"),title:f("SideView")},m.createElement("div",{className:p("point-cloud-container","bottom-view-content")},m.createElement("div",{className:p("point-cloud-container","core-instance"),ref:t}),!i&&m.createElement(I,null),m.createElement(V,{perspectiveView:y.Left})))};var D=j(B,null,null,{context:M})(X);export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointCloudSideView.js","sources":["../../../src/components/pointCloudView/PointCloudSideView.tsx"],"sourcesContent":["/**\n * @file PointCloud sideView - React Component\n * @createdate 2022-07-11\n * @author Ron <ron.f.luo@gmail.com>\n */\nimport { PointCloud, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport { getClassName } from '@/utils/dom';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport React, { useEffect, useRef } from 'react';\nimport { EPerspectiveView, IPointCloudBox, UpdatePolygonByDragList } from '@labelbee/lb-utils';\nimport { PointCloudContext } from './PointCloudContext';\nimport { SizeInfoForView } from './PointCloudInfos';\nimport { connect } from 'react-redux';\nimport { a2MapStateToProps, IA2MapStateProps } from '@/store/annotation/map';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport EmptyPage from './components/EmptyPage';\nimport useSize from '@/hooks/useSize';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n/**\n * Get the offset from canvas2d-coordinate to world coordinate\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2, // 放大倍数之后的中心点的偏移量\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\n\nconst updateSideViewByCanvas2D = (\n currentPos: { x: number; y: number },\n zoom: number,\n size: { width: number; height: number },\n selectedPointCloudBox: IPointCloudBox,\n SidePointCloud: PointCloud,\n) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n SidePointCloud.camera.zoom = zoom;\n if (currentPos) {\n const cos = Math.cos(selectedPointCloudBox.rotation);\n const sin = Math.sin(selectedPointCloudBox.rotation);\n const offsetXX = offsetX * cos;\n const offsetXY = offsetX * sin;\n const { x, y, z } = SidePointCloud.initCameraPosition;\n SidePointCloud.camera.position.set(x - offsetXX, y - offsetXY, z + offsetY);\n }\n SidePointCloud.camera.updateProjectionMatrix();\n SidePointCloud.render();\n};\n\ninterface IProps {\n checkMode?: boolean
|
|
1
|
+
{"version":3,"file":"PointCloudSideView.js","sources":["../../../src/components/pointCloudView/PointCloudSideView.tsx"],"sourcesContent":["/**\n * @file PointCloud sideView - React Component\n * @createdate 2022-07-11\n * @author Ron <ron.f.luo@gmail.com>\n */\nimport { PointCloud, PointCloudAnnotation } from '@labelbee/lb-annotation';\nimport { getClassName } from '@/utils/dom';\nimport { PointCloudContainer } from './PointCloudLayout';\nimport React, { useEffect, useRef } from 'react';\nimport { EPerspectiveView, IPointCloudBox, UpdatePolygonByDragList } from '@labelbee/lb-utils';\nimport { PointCloudContext } from './PointCloudContext';\nimport { SizeInfoForView } from './PointCloudInfos';\nimport { connect } from 'react-redux';\nimport { a2MapStateToProps, IA2MapStateProps } from '@/store/annotation/map';\nimport { usePointCloudViews } from './hooks/usePointCloudViews';\nimport { useSingleBox } from './hooks/useSingleBox';\nimport EmptyPage from './components/EmptyPage';\nimport useSize from '@/hooks/useSize';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n/**\n * Get the offset from canvas2d-coordinate to world coordinate\n * @param currentPos\n * @param size\n * @param zoom\n * @returns\n */\nconst TransferCanvas2WorldOffset = (\n currentPos: { x: number; y: number },\n size: { width: number; height: number },\n zoom = 1,\n) => {\n const { width: w, height: h } = size;\n\n const canvasCenterPoint = {\n x: currentPos.x + (w * zoom) / 2, // 放大倍数之后的中心点的偏移量\n y: currentPos.y + (h * zoom) / 2,\n };\n\n const worldCenterPoint = {\n x: size.width / 2,\n y: size.height / 2,\n };\n\n return {\n offsetX: (worldCenterPoint.x - canvasCenterPoint.x) / zoom,\n offsetY: -(worldCenterPoint.y - canvasCenterPoint.y) / zoom,\n };\n};\n\nconst updateSideViewByCanvas2D = (\n currentPos: { x: number; y: number },\n zoom: number,\n size: { width: number; height: number },\n selectedPointCloudBox: IPointCloudBox,\n SidePointCloud: PointCloud,\n) => {\n const { offsetX, offsetY } = TransferCanvas2WorldOffset(currentPos, size, zoom);\n SidePointCloud.camera.zoom = zoom;\n if (currentPos) {\n const cos = Math.cos(selectedPointCloudBox.rotation);\n const sin = Math.sin(selectedPointCloudBox.rotation);\n const offsetXX = offsetX * cos;\n const offsetXY = offsetX * sin;\n const { x, y, z } = SidePointCloud.initCameraPosition;\n SidePointCloud.camera.position.set(x - offsetXX, y - offsetXY, z + offsetY);\n }\n SidePointCloud.camera.updateProjectionMatrix();\n SidePointCloud.render();\n};\n\ninterface IProps {\n checkMode?: boolean;\n}\n\nconst PointCloudSideView: React.FC<IA2MapStateProps & IProps> = ({ config, checkMode }) => {\n const ptCtx = React.useContext(PointCloudContext);\n const { sideViewUpdateBox } = usePointCloudViews();\n const { selectedBox } = useSingleBox();\n const ref = useRef<HTMLDivElement>(null);\n const size = useSize(ref);\n const { t } = useTranslation();\n\n useEffect(() => {\n if (ref.current) {\n const size = {\n width: ref.current.clientWidth,\n height: ref.current.clientHeight,\n };\n\n const pointCloudAnnotation = new PointCloudAnnotation({\n container: ref.current,\n size,\n polygonOperationProps: { showDirectionLine: false, forbidAddNew: true },\n config,\n checkMode,\n });\n ptCtx.setSideViewInstance(pointCloudAnnotation);\n // };\n }\n }, []);\n\n useEffect(() => {\n // By the way as an initialization judgment\n if (!size || !ptCtx.sideViewInstance) {\n return;\n }\n\n const { pointCloud2dOperation, pointCloudInstance } = ptCtx.sideViewInstance;\n\n /**\n * Synchronized 3d point cloud view displacement operations\n *\n * Change Orthographic Camera size\n */\n pointCloud2dOperation.singleOn('renderZoom', (zoom: number, currentPos: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateSideViewByCanvas2D(\n currentPos,\n zoom,\n size,\n ptCtx.selectedPointCloudBox,\n pointCloudInstance,\n );\n });\n\n // Synchronized 3d point cloud view displacement operations\n pointCloud2dOperation.singleOn('dragMove', ({ currentPos, zoom }: any) => {\n if (!ptCtx.selectedPointCloudBox) {\n return;\n }\n updateSideViewByCanvas2D(\n currentPos,\n zoom,\n size,\n ptCtx.selectedPointCloudBox,\n pointCloudInstance,\n );\n });\n\n pointCloud2dOperation.singleOn('updatePolygonByDrag', (updateList: UpdatePolygonByDragList) => {\n if (ptCtx.selectedIDs.length === 1 && updateList.length === 1) {\n const { newPolygon, originPolygon } = updateList[0];\n sideViewUpdateBox(newPolygon, originPolygon);\n }\n });\n }, [ptCtx, size]);\n\n useEffect(() => {\n // Update Size\n ptCtx?.sideViewInstance?.initSize(size);\n }, [size]);\n\n return (\n <PointCloudContainer\n className={getClassName('point-cloud-container', 'side-view')}\n title={t('SideView')}\n >\n <div className={getClassName('point-cloud-container', 'bottom-view-content')}>\n <div className={getClassName('point-cloud-container', 'core-instance')} ref={ref} />\n {!selectedBox && <EmptyPage />}\n <SizeInfoForView perspectiveView={EPerspectiveView.Left} />\n </div>\n </PointCloudContainer>\n );\n};\n\nexport default connect(a2MapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudSideView,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA2BA,MAAM,0BAA6B,GAAA,CACjC,UACA,EAAA,IAAA,EACA,OAAO,CACJ,KAAA;AACH,EAAA,MAAM,CAAE,KAAA,EAAO,CAAG,EAAA,MAAA,EAAQ,CAAM,CAAA,GAAA,IAAA,CAAA;AAEhC,EAAA,MAAM,iBAAoB,GAAA;AAAA,IACxB,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,IAC/B,CAAG,EAAA,UAAA,CAAW,CAAK,GAAA,CAAA,GAAI,IAAQ,GAAA,CAAA;AAAA,GAAA,CAAA;AAGjC,EAAA,MAAM,gBAAmB,GAAA;AAAA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,mBAAD,EAAA;AAAA,IACE,SAAA,EAAW,aAAa,uBAAyB,EAAA,WAAA,CAAA;AAAA,IACjD,OAAO,CAAE,CAAA,UAAA,CAAA;AAAA,GAAA,sCAER,KAAD,EAAA;AAAA,IAAK,SAAA,EAAW,aAAa,uBAAyB,EAAA,qBAAA,CAAA;AAAA,GAAA,sCACnD,KAAD,EAAA;AAAA,IAAK,SAAA,EAAW,aAAa,uBAAyB,EAAA,eAAA,CAAA;AAAA,IAAkB,GAAA;AAAA,GAAA,CAAA,EACvE,CAAC,WAAe,oBAAA,KAAA,CAAA,aAAA,CAAC,SAAD,EAAA,IAAA,CAAA,sCAChB,eAAD,EAAA;AAAA,IAAiB,iBAAiB,gBAAiB,CAAA,IAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAM3D,2BAAe,QAAQ,iBAAmB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC/D,CAAA,CAAA,CAAA,kBAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./predictTrackingIcon/index.js";export{default}from"./predictTrackingIcon/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Button as p,message as l}from"antd";import u from"react";import{useTranslation as g}from"react-i18next";import{connect as x}from"react-redux";import h from"../../../assets/predictTracking/icon.svg.js";import{useSingleBox as y}from"../../pointCloudView/hooks/useSingleBox.js";import{ChangeSave as P,GetBoxesByID as v,SetPointCloudLoading as B,SetPredictResult as S,SetPredictResultVisible as k}from"../../../store/annotation/actionCreators.js";import{LabelBeeContext as C,useDispatch as T}from"../../../store/ctx.js";import{predict as I}from"../previewResult/util.js";var j=(i,n,e)=>new Promise((a,c)=>{var d=t=>{try{r(e.next(t))}catch(o){c(o)}},s=t=>{try{r(e.throw(t))}catch(o){c(o)}},r=t=>t.done?a(t.value):Promise.resolve(t.value).then(d,s);r((e=e.apply(i,n)).next())});const D=i=>{const n=T(),{t:e}=g(),{loading:a}=i,{selectedBox:c}=y(),d=()=>j(void 0,null,function*(){if(a)return;const s=c==null?void 0:c.info.trackID;if(!s){l.error(e("BeforePredictStarting"));return}yield n(P);const r=yield n(v(s));if(r.length<2){l.error(e("BeforePredictStarting"));return}const t=r[r.length-2],o=r[r.length-1],m=o.index-t.index;if(m<2){l.error(e("BeforePredictStarting"));return}if(m>8){l.error(e("ThePredictedPointCloud"));return}B(n,!0);const f=I(t,o);S(n,f),k(n,!0)});return u.createElement(p,{type:"link",onClick:d,style:{display:"flex",flexDirection:"column",height:"auto",alignItems:"center"}},u.createElement("img",{src:h,style:{alignSelf:"center"}}),u.createElement("span",{style:{color:"#797979"}},e("ComplementaryTracking")))},w=i=>({loading:i.annotation.loading});var R=x(w,null,null,{context:C})(D);export{R as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/predictTracking/predictTrackingIcon/index.tsx"],"sourcesContent":["import { Button, message } from 'antd';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { connect } from 'react-redux';\n\nimport icon from '@/assets/predictTracking/icon.svg';\nimport { useSingleBox } from '@/components/pointCloudView/hooks/useSingleBox';\nimport { AppState } from '@/store';\nimport {\n ChangeSave,\n GetBoxesByID,\n SetPointCloudLoading,\n SetPredictResult,\n SetPredictResultVisible,\n} from '@/store/annotation/actionCreators';\nimport { LabelBeeContext, useDispatch } from '@/store/ctx';\n\nimport { predict } from '../previewResult/util';\n\nconst PredictTrackingIcon = (props: { loading: boolean }) => {\n const dispatch = useDispatch();\n const { t } = useTranslation();\n\n const { loading } = props;\n const { selectedBox } = useSingleBox();\n\n const handler = async () => {\n if (loading) {\n return;\n }\n\n const selectedBoxTrackID = selectedBox?.info.trackID;\n\n if (!selectedBoxTrackID) {\n message.error(t('BeforePredictStarting'));\n return;\n }\n\n await dispatch(ChangeSave);\n\n const boxes: any = await dispatch(GetBoxesByID(selectedBoxTrackID));\n\n if (boxes.length < 2) {\n message.error(t('BeforePredictStarting'));\n return;\n }\n\n const start = boxes[boxes.length - 2];\n const end = boxes[boxes.length - 1];\n\n const difference = end.index - start.index;\n\n if (difference < 2) {\n message.error(t('BeforePredictStarting'));\n return;\n }\n\n if (difference > 8) {\n message.error(t('ThePredictedPointCloud'));\n return;\n }\n\n SetPointCloudLoading(dispatch, true);\n const result = predict(start, end);\n SetPredictResult(dispatch, result);\n SetPredictResultVisible(dispatch, true);\n };\n\n return (\n <Button\n type='link'\n onClick={handler}\n style={{\n display: 'flex',\n flexDirection: 'column',\n height: 'auto',\n alignItems: 'center',\n }}\n >\n <img src={icon} style={{ alignSelf: 'center' }} />\n <span style={{ color: '#797979' }}>{t('ComplementaryTracking')}</span>\n </Button>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n return {\n loading: state.annotation.loading,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(\n PredictTrackingIcon,\n);\n"],"names":["this","icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,mBAAA,GAAsB,CAAC,KAAgC,KAAA;AAC3D,EAAA,MAAM,QAAW,GAAA,WAAA,EAAA,CAAA;AACjB,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AAEd,EAAA,MAAM,CAAE,OAAY,CAAA,GAAA,KAAA,CAAA;AACpB,EAAA,MAAM,CAAE,WAAgB,CAAA,GAAA,YAAA,EAAA,CAAA;AAExB,EAAA,MAAM,UAAU,MAAY,OAAA,CAAAA,SAAA,EAAA,IAAA,EAAA,aAAA;AAC1B,IAAA,IAAI,OAAS,EAAA;AACX,MAAA,OAAA;AAAA,KAAA;AAGF,IAAM,MAAA,kBAAA,GAAqB,2CAAa,IAAK,CAAA,OAAA,CAAA;AAE7C,IAAA,IAAI,CAAC,kBAAoB,EAAA;A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L,OAAS,EAAA,OAAA;AAAA,IACT,KAAO,EAAA;AAAA,MACL,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,QAAA;AAAA,MACf,MAAQ,EAAA,MAAA;AAAA,MACR,UAAY,EAAA,QAAA;AAAA,KAAA;AAAA,GAAA,sCAGb,KAAD,EAAA;AAAA,IAAK,GAAK,EAAAC,GAAA;AAAA,IAAM,KAAA,EAAO,CAAE,SAAW,EAAA,QAAA,CAAA;AAAA,GAAA,CAAA,sCACnC,MAAD,EAAA;AAAA,IAAM,KAAA,EAAO,CAAE,KAAO,EAAA,SAAA,CAAA;AAAA,GAAA,EAAc,CAAE,CAAA,uBAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAK5C,MAAM,eAAA,GAAkB,CAAC,KAAoB,KAAA;AAC3C,EAAO,OAAA;AAAA,IACL,OAAA,EAAS,MAAM,UAAW,CAAA,OAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAI9B,4BAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC7D,CAAA,CAAA,CAAA,mBAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import C from"classnames";import n,{useState as j,useRef as S,useEffect as F}from"react";import{useTranslation as _}from"react-i18next";import{connect as L}from"react-redux";import{PointCloudContext as B}from"../../pointCloudView/PointCloudContext.js";import{SetPredictResultVisible as D,SetPredictResult as T,SetPointCloudLoading as v,BatchUpdateImgListResultByPredictResult as I}from"../../../store/annotation/actionCreators.js";import{LabelBeeContext as $,useDispatch as E}from"../../../store/ctx.js";import{getClassName as o}from"../../../utils/dom.js";import{PointCloud as z}from"@labelbee/lb-annotation";import{toolStyleConverter as U}from"@labelbee/lb-utils";import{views as A,sleep as G,getViewsDataUrl as Z}from"./util.js";var q=Object.defineProperty,H=Object.defineProperties,J=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,N=(i,e,t)=>e in i?q(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Q=(i,e)=>{for(var t in e||(e={}))K.call(e,t)&&N(i,t,e[t]);if(k)for(var t of k(e))M.call(e,t)&&N(i,t,e[t]);return i},W=(i,e)=>H(i,J(e)),O=(i,e,t)=>new Promise((d,r)=>{var s=c=>{try{l(t.next(c))}catch(u){r(u)}},a=c=>{try{l(t.throw(c))}catch(u){r(u)}},l=c=>c.done?d(c.value):Promise.resolve(c.value).then(s,a);l((t=t.apply(i,e)).next())});const X=i=>{const{predictionResult:e,predictionResultVisible:t,imgList:d}=i,[r,s]=j([]),a=E(),{t:l}=_(),c=()=>{D(a,!1),T(a,[]),s([])},u=()=>O(void 0,null,function*(){v(a,!0),yield a(I()),v(a,!1),c()});return t?n.createElement(n.Fragment,null,r.length>0&&n.createElement("div",{className:o("point-cloud-predict-tracking-container")},n.createElement("div",{className:o("point-cloud-predict-tracking-container","bar")},n.createElement("div",{className:o("point-cloud-predict-tracking-container","title")},n.createElement("div",null,l("ComplementaryTrackingPrediction"),r.length>0?`\uFF08${r.length}\uFF09`:""),n.createElement("div",{className:o("point-cloud-predict-tracking-container","option")},n.createElement("div",{className:C([o("point-cloud-predict-tracking-container","cancelOption"),o("point-cloud-predict-tracking-container","button")]),onClick:c},l("Cancel")),n.createElement("div",{className:C([o("point-cloud-predict-tracking-container","okOption"),o("point-cloud-predict-tracking-container","button")]),onClick:u},l("Apply")))),n.createElement("div",{className:o("point-cloud-predict-tracking-container","content")},n.createElement(Y,{list:r})))),e.length>0&&n.createElement(ee,{result:e,imgList:d,setList:s})):null},Y=i=>{const{list:e}=i,{t}=_(),d=[t("TopView"),t("SideView"),t("BackView")];return n.createElement(n.Fragment,null,n.createElement("div",{className:o("point-cloud-predict-tracking-container","left")},d.map(r=>n.createElement("div",{className:o("point-cloud-predict-tracking-container","title"),key:r},r))),n.createElement("div",{className:o("point-cloud-predict-tracking-container","right")},e.map(r=>n.createElement("div",{className:o("point-cloud-predict-tracking-container","item"),key:r.id},A.map(s=>{const a=r[s];return n.createElement("div",{className:o("point-cloud-predict-tracking-container","view"),key:`${r.id}-${s}`},n.createElement("img",{src:a}))})))))},ee=i=>{const e=n.useContext(B),t=E(),{result:d,imgList:r,setList:s}=i,a=S(null),l={width:600,height:600};return F(()=>{(()=>O(void 0,null,function*(){var u,h,y,P,w,b;const f=(u=e.mainViewInstance)==null?void 0:u.config;if(f&&a.current){const R={left:-l.width/2,right:l.width/2,top:l.height/2,bottom:-l.height/2,near:200,far:-200},p=new z({container:a.current,isOrthographicCamera:!0,orthographicParams:R,config:f});p.setShowDirection(!1);for(const m of d){const{index:g}=m,x=r[g].url?r[g].url:(w=(P=(y=(h=r[g])==null?void 0:h.webPointCloudFile)==null?void 0:y.lidar)==null?void 0:P.url)!=null?w:"";yield p.loadPCDFileByBox(x,m,{width:2,height:2,depth:2}),yield p.updateCameraZoom(e.zoom);const V=(b=U.getColorFromConfig({attribute:m.attribute},W(Q({},f),{attributeConfigurable:!0}),{}))==null?void 0:b.hex;p.generateBox(m,V),yield G(500),yield Z(p,m,e.zoom),yield p.removeObjectByName(m.id),yield p.clearPointCloudAndRender()}s(d),v(t,!1)}}))()},[]),n.createElement("div",{style:l,ref:a,className:"generate-view"})},te=i=>({predictionResult:i.annotation.predictionResult,predictionResultVisible:i.annotation.predictionResultVisible,imgList:i.annotation.imgList});var ne=L(te,null,null,{context:$})(X);export{ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/predictTracking/previewResult/index.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport _ from 'lodash';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { connect } from 'react-redux';\n\nimport { PointCloudContext } from '@/components/pointCloudView/PointCloudContext';\nimport { AppState } from '@/store';\nimport {\n BatchUpdateImgListResultByPredictResult,\n SetPointCloudLoading,\n SetPredictResult,\n SetPredictResultVisible,\n} from '@/store/annotation/actionCreators';\nimport { IPointCloudBoxWithIndex } from '@/store/annotation/types';\nimport { LabelBeeContext, useDispatch } from '@/store/ctx';\nimport { IFileItem } from '@/types/data';\nimport { getClassName } from '@/utils/dom';\nimport { PointCloud } from '@labelbee/lb-annotation';\nimport { toolStyleConverter } from '@labelbee/lb-utils';\n\nimport { getViewsDataUrl, IBox, sleep, views } from './util';\n\ninterface IProps {\n imgList: IFileItem[];\n predictionResultVisible: boolean;\n predictionResult: IPointCloudBoxWithIndex[];\n}\n\nconst PreviewResult = (props: IProps) => {\n const { predictionResult, predictionResultVisible, imgList } = props;\n\n const [list, setList] = useState<IBox[]>([]);\n const dispatch = useDispatch();\n const { t } = useTranslation();\n\n const close = () => {\n SetPredictResultVisible(dispatch, false);\n SetPredictResult(dispatch, []);\n setList([]);\n };\n\n const apply = async () => {\n SetPointCloudLoading(dispatch, true);\n await dispatch(BatchUpdateImgListResultByPredictResult());\n SetPointCloudLoading(dispatch, false);\n close();\n };\n\n return predictionResultVisible ? (\n <>\n {list.length > 0 && (\n <div className={getClassName('point-cloud-predict-tracking-container')}>\n <div className={getClassName('point-cloud-predict-tracking-container', 'bar')}>\n <div className={getClassName('point-cloud-predict-tracking-container', 'title')}>\n <div>\n {t('ComplementaryTrackingPrediction')}\n {list.length > 0 ? `(${list.length})` : ''}\n </div>\n <div className={getClassName('point-cloud-predict-tracking-container', 'option')}>\n <div\n className={classNames([\n getClassName('point-cloud-predict-tracking-container', 'cancelOption'),\n getClassName('point-cloud-predict-tracking-container', 'button'),\n ])}\n onClick={close}\n >\n {t('Cancel')}\n </div>\n\n <div\n className={classNames([\n getClassName('point-cloud-predict-tracking-container', 'okOption'),\n getClassName('point-cloud-predict-tracking-container', 'button'),\n ])}\n onClick={apply}\n >\n {t('Apply')}\n </div>\n </div>\n </div>\n\n <div className={getClassName('point-cloud-predict-tracking-container', 'content')}>\n <Result list={list} />\n </div>\n </div>\n </div>\n )}\n {predictionResult.length > 0 && (\n <GenerateViewsDataUrl result={predictionResult} imgList={imgList} setList={setList} />\n )}\n </>\n ) : null;\n};\n\nconst Result = (props: { list: IBox[] }) => {\n const { list } = props;\n const { t } = useTranslation();\n const viewsTitle = [t('TopView'), t('SideView'), t('BackView')];\n\n return (\n <>\n <div className={getClassName('point-cloud-predict-tracking-container', 'left')}>\n {viewsTitle.map((i) => (\n <div className={getClassName('point-cloud-predict-tracking-container', 'title')} key={i}>\n {i}\n </div>\n ))}\n </div>\n <div className={getClassName('point-cloud-predict-tracking-container', 'right')}>\n {list.map((i) => {\n return (\n <div\n className={getClassName('point-cloud-predict-tracking-container', 'item')}\n key={i.id}\n >\n {views.map((view) => {\n const url = i[view];\n return (\n <div\n className={getClassName('point-cloud-predict-tracking-container', 'view')}\n key={`${i.id}-${view}`}\n >\n <img src={url} />\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n </>\n );\n};\n\nconst GenerateViewsDataUrl = (props: {\n result: IPointCloudBoxWithIndex[];\n imgList: IFileItem[];\n setList: (list: IBox[]) => void;\n}) => {\n const ptCtx = React.useContext(PointCloudContext);\n const dispatch = useDispatch();\n\n const { result, imgList, setList } = props;\n\n const ref = useRef<HTMLDivElement>(null);\n\n const size = {\n width: 600,\n height: 600,\n };\n\n useEffect(() => {\n const generate = async () => {\n const config = ptCtx.mainViewInstance?.config;\n\n if (config && ref.current) {\n const orthographicParams = {\n left: -size.width / 2,\n right: size.width / 2,\n top: size.height / 2,\n bottom: -size.height / 2,\n near: 200,\n far: -200,\n };\n\n const pointCloud = new PointCloud({\n container: ref.current,\n isOrthographicCamera: true,\n orthographicParams,\n config,\n });\n\n pointCloud.setShowDirection(false);\n\n for (const item of result) {\n const { index } = item;\n\n const url = imgList[index].url\n ? imgList[index].url\n : // @ts-ignore\n imgList[index]?.webPointCloudFile?.lidar?.url ?? '';\n\n await pointCloud.loadPCDFileByBox(url, item, {\n width: 2,\n height: 2,\n depth: 2,\n });\n\n await pointCloud.updateCameraZoom(ptCtx.zoom);\n\n const hex = toolStyleConverter.getColorFromConfig(\n { attribute: item.attribute },\n { ...config, attributeConfigurable: true },\n {},\n )?.hex;\n\n pointCloud.generateBox(item, hex);\n // TODO\n // getViewsDataUrl requires pointCloud to finish loading the 3D view, otherwise it will not capture the correct image\n await sleep(500);\n await getViewsDataUrl(pointCloud, item, ptCtx.zoom);\n await pointCloud.removeObjectByName(item.id);\n await pointCloud.clearPointCloudAndRender();\n }\n\n setList(result);\n SetPointCloudLoading(dispatch, false);\n }\n };\n\n generate();\n }, []);\n\n return <div style={size} ref={ref} className='generate-view' />;\n};\n\nconst mapStateToProps = (state: AppState) => ({\n predictionResult: state.annotation.predictionResult,\n predictionResultVisible: state.annotation.predictionResultVisible,\n imgList: state.annotation.imgList,\n});\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(PreviewResult);\n"],"names":["this"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,aAAA,GAAgB,CAAC,KAAkB,KAAA;AACvC,EAAM,MAAA,CAAE,gBAAkB,EAAA,uBAAA,EAAyB,OAAY,CAAA,GAAA,KAAA,CAAA;AAE/D,EAAM,MAAA,CAAC,IAAM,EAAA,OAAA,CAAA,GAAW,QAAiB,CAAA,EAAA,CAAA,CAAA;AACzC,EAAA,MAAM,QAAW,GAAA,WAAA,EAAA,CAAA;AACjB,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AAEd,EAAA,MAAM,QAAQ,MAAM;AAClB,IAAA,uBAAA,CAAwB,QAAU,EAAA,KAAA,CAAA,CAAA;AAClC,IAAA,gBAAA,CAAiB,QAAU,EAAA,EAAA,CAAA,CAAA;AAC3B,IAAQ,OAAA,CAAA,EAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAGV,EAAA,MAAM,QAAQ,MAAY,OAAA,CAAAA,SAAA,EAAA,IAAA,EAAA,aAAA;A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CAAA;AAG/C,MAAM,eAAA,GAAkB,CAAC,KAAqB,MAAA;AAAA,EAC5C,gBAAA,EAAkB,MAAM,UAAW,CAAA,gBAAA;AAAA,EACnC,uBAAA,EAAyB,MAAM,UAAW,CAAA,uBAAA;AAAA,EAC1C,OAAA,EAAS,MAAM,UAAW,CAAA,OAAA;AAAA,CAAA,CAAA,CAAA;AAG5B,sBAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAAmB,CAAA,CAAA,CAAA,aAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsonParser as E}from"../../../utils/index.js";import{uuid as O}from"@labelbee/lb-annotation";import{EPerspectiveView as f}from"@labelbee/lb-utils";var b=Object.defineProperty,g=Object.defineProperties,I=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable,m=(t,e,r)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_=(t,e)=>{for(var r in e||(e={}))B.call(e,r)&&m(t,r,e[r]);if(v)for(var r of v(e))D.call(e,r)&&m(t,r,e[r]);return t},w=(t,e)=>g(t,I(e)),P=(t,e,r)=>new Promise((o,i)=>{var s=n=>{try{c(r.next(n))}catch(l){i(l)}},u=n=>{try{c(r.throw(n))}catch(l){i(l)}},c=n=>n.done?o(n.value):Promise.resolve(n.value).then(s,u);c((r=r.apply(t,e)).next())});const h={width:160,height:110},j=(t,e=2)=>P(void 0,null,function*(){return S(t.domElement,h.width,h.height,e)}),A=(t=300)=>new Promise(e=>{setTimeout(()=>{e("")},t)}),x=[f.Top,f.Left,f.Back],C=(t,e,r)=>P(void 0,null,function*(){for(const o of x)yield t.updateCameraByBox(e,o),e[o]=yield j(t.renderer,r)}),S=(t,e,r,o)=>{if(!t)return"";const i=t.width/2,s=t.height/2,u=i-e/2,c=s-r/2,n=document.createElement("canvas");n.width=e*o,n.height=r*o;const l=n.getContext("2d");return l==null||l.drawImage(t,u,c,e,r,0,0,e*o,r*o),n.toDataURL()},V=(t,e,r)=>{const o=[];return t.forEach((i,s)=>{var u;const c=E(i==null?void 0:i.result),n=(u=c==null?void 0:c[`step_${e}`])==null?void 0:u.result,l=n==null?void 0:n.find(p=>p.trackID===r);l&&o.push(w(_({},l),{index:s}))}),o},L=(t,e)=>{const o=e.index-t.index-1,i=[],s={},u=["x","y","z"],c=["center","depth","height","index","rotation","width"];u.forEach(n=>{s[n]=y(t.center[n],e.center[n],o)}),c.forEach(n=>{n!=="center"&&(s[n]=y(t[n],e[n],o))});for(let n=0;n<o;n++){const l=u.reduce((a,d)=>(a[d]=s[d][n],a),{x:0,y:0,z:0}),p=c.reduce((a,d)=>(d==="center"||(a[d]=s[d][n]),a),w(_({},t),{id:O(),center:l}));i.push(p)}return i},y=(t=0,e=0,r=0)=>{const o=(e-t)/(r+1),i=new Array(r);for(let s=0;s<r;s++)i[s]=t+o*(s+1);return i};export{V as getBoxesByTrackID,C as getViewsDataUrl,L as predict,A as sleep,x as views};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../src/components/predictTracking/previewResult/util.ts"],"sourcesContent":["import { IPointCloudBoxWithIndex } from '@/store/annotation/types';\nimport { IFileItem } from '@/types/data';\nimport { jsonParser } from '@/utils';\nimport { PointCloud, uuid } from '@labelbee/lb-annotation';\nimport { EPerspectiveView, IPointCloudBox } from '@labelbee/lb-utils';\n\nconst EXAMPLE_IMAGE_SIZE = {\n width: 160,\n height: 110,\n} as const;\n\n/**\n * Returns a data URL for an image of the rendered point cloud.\n * @param renderer - The PointCloud renderer to use.\n * @param zoom - The zoom level of the image. Defaults to 2.\n * @returns A Promise resolving to a string data URL of the rendered image.\n */\nconst getDataUrl = async (renderer: PointCloud['renderer'], zoom = 2) => {\n return cropAndEnlarge(\n renderer.domElement,\n EXAMPLE_IMAGE_SIZE.width,\n EXAMPLE_IMAGE_SIZE.height,\n zoom,\n );\n};\n\n/**\n * Returns a Promise that resolves after the specified duration.\n * @param ms - The duration to sleep, in milliseconds.\n * @returns A Promise that resolves after `ms` milliseconds.\n */\nexport const sleep = (time = 300) => {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve('');\n }, time);\n });\n};\n\nexport const views = [EPerspectiveView.Top, EPerspectiveView.Left, EPerspectiveView.Back] as const;\n\ninterface viewDataUrl {\n [EPerspectiveView.Top]?: string;\n [EPerspectiveView.Left]?: string;\n [EPerspectiveView.Back]?: string;\n}\n\nexport type IBox = IPointCloudBoxWithIndex & viewDataUrl;\n\n/**\n * Generates data URLs for each view of a given point cloud object using the provided box and zoom level.\n *\n * @param {PointCloud} pointCloud - The point cloud object to generate data URLs for.\n * @param {IBox} box - An object representing the bounding box to use for calculating camera position.\n * @param {number} zoom - The zoom level to use when generating data URLs.\n * @returns {Promise<void>} - A promise that resolves once all data URLs have been generated.\n */\nexport const getViewsDataUrl = async (pointCloud: PointCloud, box: IBox, zoom: number) => {\n for (const view of views) {\n await pointCloud.updateCameraByBox(box, view);\n box[view] = await getDataUrl(pointCloud.renderer, zoom);\n }\n};\n\n/**\n * Creates a new canvas, crops and enlarges an existing canvas, draws the cropped and enlarged image onto the new canvas,\n * and returns the data URL of the new canvas.\n *\n * @param {HTMLCanvasElement} canvas - The original canvas to be cropped and enlarged\n * @param {number} width - The width of the area to be cropped from the center of the original canvas\n * @param {number} height - The height of the area to be cropped from the center of the original canvas\n * @param {number} scale - The amount by which to enlarge the cropped area\n * @returns {string} - A data URL of the cropped and enlarged image\n */\nconst cropAndEnlarge = (\n canvas: HTMLCanvasElement,\n width: number,\n height: number,\n scale: number,\n): string => {\n if (!canvas) {\n return '';\n }\n const centerX = canvas.width / 2;\n const centerY = canvas.height / 2;\n // Calculate starting coordinates for cropping\n const sx = centerX - width / 2;\n const sy = centerY - height / 2;\n\n // Create a new canvas for the cropped and enlarged image\n const newCanvas = document.createElement('canvas');\n newCanvas.width = width * scale;\n newCanvas.height = height * scale;\n\n // Draw the cropped and enlarged image onto the new canvas\n const newCtx = newCanvas.getContext('2d');\n newCtx?.drawImage(canvas, sx, sy, width, height, 0, 0, width * scale, height * scale);\n\n // Convert the new canvas to a data URL and return it\n return newCanvas.toDataURL();\n};\n\n/**\n * Retrieve boxes with a specific trackID from an array of file items.\n *\n * @param {Array} imageList - An array of file items to search through.\n * @param {Number} targetStep - The step number within the result object to retrieve boxes from.\n * @param {Number} selectedBoxTrackID - The trackID to match when searching for boxes.\n * @return {Array} An array of point cloud boxes that match the provided trackID, along with their index in the original array.\n */\nexport const getBoxesByTrackID = (\n imageList: IFileItem[],\n targetStep: number,\n selectedBoxTrackID: number,\n) => {\n const matchingBoxes: IPointCloudBoxWithIndex[] = [];\n imageList.forEach((element, index) => {\n const fileResult = jsonParser(element?.result);\n const stepResult = fileResult?.[`step_${targetStep}`]?.result;\n const box = stepResult?.find((item: IPointCloudBox) => item.trackID === selectedBoxTrackID);\n if (box) {\n matchingBoxes.push({ ...box, index });\n }\n });\n\n return matchingBoxes;\n};\n\n/**\n * Calculate predicted values for each field in between the start and end points.\n * @param {IPointCloudBoxWithIndex} start - The starting point, should have the same properties as IPointCloudBoxWithIndex.\n * @param {IPointCloudBoxWithIndex} end - The ending point, should have the same properties as IPointCloudBoxWithIndex.\n * @returns {IPointCloudBox[]} An array of objects with the same properties as IPointCloudBox, containing interpolated values between the start and end points for each field.\n */\nexport const predict = (start: IPointCloudBoxWithIndex, end: IPointCloudBoxWithIndex) => {\n const diff = end.index - start.index;\n const len = diff - 1;\n const result: IPointCloudBox[] = [];\n const map: { [key: string]: number[] } = {};\n const centerKeys = ['x', 'y', 'z'] as const;\n const predictKeys = ['center', 'depth', 'height', 'index', 'rotation', 'width'] as const;\n\n centerKeys.forEach((key) => {\n map[key] = getInteriorNumbersByStartAndEnd(start.center[key], end.center[key], len);\n });\n\n predictKeys.forEach((key) => {\n if (key === 'center') {\n return;\n }\n map[key] = getInteriorNumbersByStartAndEnd(start[key], end[key], len);\n });\n\n for (let i = 0; i < len; i++) {\n const nextCenter = centerKeys.reduce(\n (acc, key) => {\n acc[key] = map[key][i];\n return acc;\n },\n { x: 0, y: 0, z: 0 },\n );\n\n const nextValue = predictKeys.reduce(\n (acc, key) => {\n if (key === 'center') {\n return acc;\n }\n acc[key] = map[key][i];\n return acc;\n },\n { ...start, id: uuid(), center: nextCenter },\n );\n\n result.push(nextValue);\n }\n\n return result;\n};\n\n/**\n * Calculate an array of numbers between the start and end values.\n * @param {number} [start=0] - The starting value. Defaults to 0 if not specified.\n * @param {number} [end=0] - The ending value. Defaults to 0 if not specified.\n * @param {number} [length=0] - The number of values to calculate between the start and end points. Defaults to 0 if not specified.\n * @returns {number[]} An array of numbers, containing interpolated values between the start and end points.\n */\nconst getInteriorNumbersByStartAndEnd = (start = 0, end = 0, length = 0): number[] => {\n const step = (end - start) / (length + 1);\n const resultArr = new Array(length);\n for (let i = 0; i < length; i++) {\n resultArr[i] = start + step * (i + 1);\n }\n return resultArr;\n};\n"],"names":["this"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,kBAAqB,GAAA;AAAA,EACzB,KAAO,EAAA,GAAA;AAAA,EACP,MAAQ,EAAA,GAAA;AAAA,CAAA,CAAA;AASV,MAAM,UAAa,GAAA,CAAO,QAAkC,EAAA,IAAA,GAAO,CAAM,KAAA,OAAA,CAAAA,SAAA,EAAA,IAAA,EAAA,aAAA;AACvE,EAAA,OAAO,eACL,QAAS,CAAA,UAAA,EACT,kBAAmB,CAAA,KAAA,EACnB,mBAAmB,MACnB,EAAA,IAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA;AASS,MAAA,KAAA,GAAQ,CAAC,IAAA,GAAO,GAAQ,KAAA;AACnC,EAAO,OAAA,IAAI,OAAQ,CAAA,CAAC,OAAY,KAAA;AAC9B,IAAA,UAAA,CAAW,MAAM;AACf,MAAQ,OAAA,CAAA,EAAA,CAAA,C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AA;AAGnB,IAAA,MAAM,SAAY,GAAA,WAAA,CAAY,MAC5B,CAAA,CAAC,KAAK,GAAQ,KAAA;AACZ,MAAA,IAAI,QAAQ,QAAU,EAAA;AACpB,QAAO,OAAA,GAAA,CAAA;AAAA,OAAA;AAET,MAAI,GAAA,CAAA,GAAA,CAAA,GAAO,IAAI,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA;AACpB,MAAO,OAAA,GAAA,CAAA;AAAA,KAAA,EAET,aAAK,CAAA,cAAA,CAAA,EAAA,EAAA,KAAA,CAAA,EAAL,CAAY,EAAA,EAAI,QAAQ,MAAQ,EAAA,UAAA,CAAA,CAAA,CAAA,CAAA;AAGlC,IAAA,MAAA,CAAO,IAAK,CAAA,SAAA,CAAA,CAAA;AAAA,GAAA;AAGd,EAAO,OAAA,MAAA,CAAA;AAAA,EAAA;AAUT,MAAM,kCAAkC,CAAC,KAAA,GAAQ,GAAG,GAAM,GAAA,CAAA,EAAG,SAAS,CAAgB,KAAA;AACpF,EAAM,MAAA,IAAA,GAAQ,CAAM,GAAA,GAAA,KAAA,KAAmB,MAAA,GAAA,CAAA,CAAA,CAAA;AACvC,EAAM,MAAA,SAAA,GAAY,IAAI,KAAM,CAAA,MAAA,CAAA,CAAA;AAC5B,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,MAAA,EAAQ,CAAK,EAAA,EAAA;AAC/B,IAAU,SAAA,CAAA,CAAA,CAAA,GAAK,KAAQ,GAAA,IAAA,IAAY,CAAA,GAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAErC,EAAO,OAAA,SAAA,CAAA;AAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useContext as I,useState as C,useEffect as B}from"react";import{EditFilled as w}from"@ant-design/icons";import{ToolIcons as L}from"../ToolIcons.js";import{cTool as j}from"@labelbee/lb-annotation";import{PointCloudContext as b}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as E,Tag as _,Input as A,Select as T,message as v}from"antd";import F from"../../../../utils/StepUtils.js";import{connect as V}from"react-redux";import{jsonParser as N}from"../../../../utils/index.js";import{useStatus as U}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as h}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as k}from"react-i18next";import{LabelBeeContext as M}from"../../../../store/ctx.js";import z from"./components/batchUpdateModal/index.js";import{PointCloudUtils as W}from"@labelbee/lb-utils";import P from"../../../../components/attributeList/index.js";import{useAttribute as O}from"../../../../components/pointCloudView/hooks/useAttribute.js";const R=({imgList:n,imgIndex:u})=>{const c=I(b),[a,m]=C([]),{t:i}=k();B(()=>{const r=n;let o=new Map;m(W.getAllPointCloudResult({imgList:r,extraBoxList:f,ignoreIndexList:[u]}).filter(l=>!l.trackID||o.get(l.trackID)?!1:(o.set(l.trackID,!0),!0)).sort((l,s)=>{var d,t;const x=(d=l==null?void 0:l.trackID)!=null?d:0,g=(t=s==null?void 0:s.trackID)!=null?t:0;return x-g}).map(l=>{var s;return(s=l==null?void 0:l.trackID)!=null?s:0}))},[c.pointCloudBoxList,n]);const{pointCloudBoxList:f}=c;return e.createElement("div",{style:{padding:24,borderBottom:"1px solid #eee"}},e.createElement("div",{style:{marginBottom:16}},i("AllTrackIDs")),e.createElement("div",null,a.map(r=>e.createElement(_,{color:"#F3F4FF",key:r,style:{color:"#666",marginBottom:8}},r))))},$=()=>{const[n,u]=C(!1),{pointCloudBoxList:c}=I(b),{selectedBox:a,updateSelectedBox:m}=h(),[i,f]=C(""),{t:r}=k(),o=a==null?void 0:a.info.trackID,l=d=>!!c.find(x=>x.trackID===d&&x.id!==(a==null?void 0:a.info.id)),s=(d=!1)=>{const t=parseInt(i,10);if(d&&u(!1),isNaN(t)){v.error(r("PositiveIntegerCheck"));return}if(i.indexOf(".")>-1){v.error(r("NotAllowDecimalPointsInTrackID"));return}if(l(t)){v.error(r("DuplicateTrackIDsExist"));return}if(!(t>0)){v.error(r("PositiveIntegerCheck"));return}m({trackID:t})};return B(()=>{u(!1)},[o]),e.createElement("div",{style:{padding:24}},e.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",null,r("CurrentBoxTrackIDs")),o&&e.createElement(z,{id:o})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n&&o?e.createElement(A,{defaultValue:o,onChange:d=>{f(d.target.value)},disabled:!o,size:"small",onBlur:()=>{s()},onPressEnter:()=>{s(!0)}}):e.createElement("span",null,o),e.createElement(w,{style:{color:"#999",marginLeft:16,cursor:typeof o!="undefined"?"pointer":"not-allowed"},onClick:()=>{o&&u(!n)}})))},q=({attributeList:n,subAttributeList:u,toolInstance:c})=>{const{selectedBox:a}=h(),m=I(b),{t:i}=k(),{defaultAttribute:f}=O(),r={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"},o={margin:"12px 20px 8px",fontSize:14,fontWeight:500,wordWrap:"break-word"},l=t=>{c.setDefaultAttribute(t)},s=(t,x)=>{c.setSubAttribute(t,x)},d=n.map(t=>({label:t.key,value:t.value,color:t==null?void 0:t.color}));return e.createElement("div",null,e.createElement("div",{style:r},i("Attribute")),e.createElement(P,{list:d,forbidDefault:!0,selectedAttribute:f!=null?f:"",attributeChanged:t=>l(t)}),e.createElement(E,{style:{margin:0}}),a&&e.createElement(e.Fragment,null,u.map(t=>{var x,g,y,D,S;return(t==null?void 0:t.subSelected)&&e.createElement("div",{style:{marginTop:12},key:t.value},e.createElement("div",{style:o},i("SubAttribute"),"-",t.key),((x=t.subSelected)==null?void 0:x.length)<5?e.createElement(P,{list:t.subSelected.map(p=>({label:p.key,value:p.value})),selectedAttribute:(y=(g=m.selectedPointCloudBox)==null?void 0:g.subAttribute)==null?void 0:y[t.value],num:"-",forbidColor:!0,forbidDefault:!0,attributeChanged:p=>s(t.value,p),style:{marginBottom:12}}):e.createElement(T,{style:{margin:"0px 21px 17px 16px",width:"87%"},value:(S=(D=m.selectedPointCloudBox)==null?void 0:D.subAttribute)==null?void 0:S[t.value],placeholder:i("PleaseSelect"),onChange:p=>s(t.value,p),allowClear:!0},t.subSelected.map(p=>e.createElement(T.Option,{key:p.value,value:p.value},p.key))),e.createElement(E,{style:{margin:0}}))})))},G=({stepInfo:n,toolInstance:u,imgList:c,imgIndex:a})=>{var m,i;const{updatePointCloudPattern:f,pointCloudPattern:r}=U(),o=N(n.config),l=(m=o==null?void 0:o.attributeList)!=null?m:[],s=(o==null?void 0:o.secondaryAttributeConfigurable)===!0?(i=o==null?void 0:o.inputList)!=null?i:[]:[];return e.createElement(e.Fragment,null,e.createElement(L,{toolName:j.EPointCloudName.PointCloud,selectedToolName:r,onChange:d=>f==null?void 0:f(d)}),(o==null?void 0:o.trackConfigurable)===!0&&e.createElement(e.Fragment,null,e.createElement(
|
|
1
|
+
import e,{useContext as I,useState as C,useEffect as B}from"react";import{EditFilled as w}from"@ant-design/icons";import{ToolIcons as L}from"../ToolIcons.js";import{cTool as j}from"@labelbee/lb-annotation";import{PointCloudContext as b}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as E,Tag as _,Input as A,Select as T,message as v}from"antd";import F from"../../../../utils/StepUtils.js";import{connect as V}from"react-redux";import{jsonParser as N}from"../../../../utils/index.js";import{useStatus as U}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as h}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as k}from"react-i18next";import{LabelBeeContext as M}from"../../../../store/ctx.js";import z from"./components/batchUpdateModal/index.js";import{PointCloudUtils as W}from"@labelbee/lb-utils";import P from"../../../../components/attributeList/index.js";import{useAttribute as O}from"../../../../components/pointCloudView/hooks/useAttribute.js";const R=({imgList:n,imgIndex:u})=>{const c=I(b),[a,m]=C([]),{t:i}=k();B(()=>{const r=n;let o=new Map;m(W.getAllPointCloudResult({imgList:r,extraBoxList:f,ignoreIndexList:[u]}).filter(l=>!l.trackID||o.get(l.trackID)?!1:(o.set(l.trackID,!0),!0)).sort((l,s)=>{var d,t;const x=(d=l==null?void 0:l.trackID)!=null?d:0,g=(t=s==null?void 0:s.trackID)!=null?t:0;return x-g}).map(l=>{var s;return(s=l==null?void 0:l.trackID)!=null?s:0}))},[c.pointCloudBoxList,n]);const{pointCloudBoxList:f}=c;return e.createElement("div",{style:{padding:24,borderBottom:"1px solid #eee"}},e.createElement("div",{style:{marginBottom:16}},i("AllTrackIDs")),e.createElement("div",null,a.map(r=>e.createElement(_,{color:"#F3F4FF",key:r,style:{color:"#666",marginBottom:8}},r))))},$=()=>{const[n,u]=C(!1),{pointCloudBoxList:c}=I(b),{selectedBox:a,updateSelectedBox:m}=h(),[i,f]=C(""),{t:r}=k(),o=a==null?void 0:a.info.trackID,l=d=>!!c.find(x=>x.trackID===d&&x.id!==(a==null?void 0:a.info.id)),s=(d=!1)=>{const t=parseInt(i,10);if(d&&u(!1),isNaN(t)){v.error(r("PositiveIntegerCheck"));return}if(i.indexOf(".")>-1){v.error(r("NotAllowDecimalPointsInTrackID"));return}if(l(t)){v.error(r("DuplicateTrackIDsExist"));return}if(!(t>0)){v.error(r("PositiveIntegerCheck"));return}m({trackID:t})};return B(()=>{u(!1)},[o]),e.createElement("div",{style:{padding:24}},e.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",null,r("CurrentBoxTrackIDs")),o&&e.createElement(z,{id:o})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n&&o?e.createElement(A,{defaultValue:o,onChange:d=>{f(d.target.value)},disabled:!o,size:"small",onBlur:()=>{s()},onPressEnter:()=>{s(!0)}}):e.createElement("span",null,o),e.createElement(w,{style:{color:"#999",marginLeft:16,cursor:typeof o!="undefined"?"pointer":"not-allowed"},onClick:()=>{o&&u(!n)}})))},q=({attributeList:n,subAttributeList:u,toolInstance:c})=>{const{selectedBox:a}=h(),m=I(b),{t:i}=k(),{defaultAttribute:f}=O(),r={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"},o={margin:"12px 20px 8px",fontSize:14,fontWeight:500,wordWrap:"break-word"},l=t=>{c.setDefaultAttribute(t)},s=(t,x)=>{c.setSubAttribute(t,x)},d=n.map(t=>({label:t.key,value:t.value,color:t==null?void 0:t.color}));return e.createElement("div",null,e.createElement("div",{style:r},i("Attribute")),e.createElement(P,{list:d,forbidDefault:!0,selectedAttribute:f!=null?f:"",attributeChanged:t=>l(t)}),e.createElement(E,{style:{margin:0}}),a&&e.createElement(e.Fragment,null,u.map(t=>{var x,g,y,D,S;return(t==null?void 0:t.subSelected)&&e.createElement("div",{style:{marginTop:12},key:t.value},e.createElement("div",{style:o},i("SubAttribute"),"-",t.key),((x=t.subSelected)==null?void 0:x.length)<5?e.createElement(P,{list:t.subSelected.map(p=>({label:p.key,value:p.value})),selectedAttribute:(y=(g=m.selectedPointCloudBox)==null?void 0:g.subAttribute)==null?void 0:y[t.value],num:"-",forbidColor:!0,forbidDefault:!0,attributeChanged:p=>s(t.value,p),style:{marginBottom:12}}):e.createElement(T,{style:{margin:"0px 21px 17px 16px",width:"87%"},value:(S=(D=m.selectedPointCloudBox)==null?void 0:D.subAttribute)==null?void 0:S[t.value],placeholder:i("PleaseSelect"),onChange:p=>s(t.value,p),allowClear:!0},t.subSelected.map(p=>e.createElement(T.Option,{key:p.value,value:p.value},p.key))),e.createElement(E,{style:{margin:0}}))})))},G=({stepInfo:n,toolInstance:u,imgList:c,imgIndex:a})=>{var m,i;const{updatePointCloudPattern:f,pointCloudPattern:r}=U(),o=N(n.config),l=(m=o==null?void 0:o.attributeList)!=null?m:[],s=(o==null?void 0:o.secondaryAttributeConfigurable)===!0?(i=o==null?void 0:o.inputList)!=null?i:[]:[];return e.createElement(e.Fragment,null,e.createElement(L,{toolName:j.EPointCloudName.PointCloud,selectedToolName:r,onChange:d=>f==null?void 0:f(d)}),e.createElement(q,{toolInstance:u,attributeList:l,subAttributeList:s}),(o==null?void 0:o.trackConfigurable)===!0&&e.createElement(e.Fragment,null,e.createElement($,null),e.createElement(E,{style:{margin:0}}),e.createElement(R,{imgList:c,imgIndex:a})))},H=n=>{var u,c,a;const m=F.getCurrentStepInfo((u=n.annotation)==null?void 0:u.step,(c=n.annotation)==null?void 0:c.stepList),i=(a=n.annotation)==null?void 0:a.toolInstance;return{stepInfo:m,toolInstance:i,imgList:n.annotation.imgList,imgIndex:n.annotation.imgIndex}};var J=V(H,null,null,{context:M})(G);export{J as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx"],"sourcesContent":["import React, { useContext, useState, useEffect } from 'react';\nimport { EditFilled } from '@ant-design/icons';\nimport { ToolIcons } from '../ToolIcons';\nimport { cTool } from '@labelbee/lb-annotation';\nimport { PointCloudContext } from '@/components/pointCloudView/PointCloudContext';\nimport { Select, Tag, message, Input, Divider } from 'antd';\nimport { AppState } from '@/store';\nimport StepUtils from '@/utils/StepUtils';\nimport { connect } from 'react-redux';\nimport { IStepInfo } from '@/types/step';\nimport { jsonParser } from '@/utils';\nimport { ICustomToolInstance } from '@/hooks/annotation';\nimport { useStatus } from '@/components/pointCloudView/hooks/useStatus';\nimport { useSingleBox } from '@/components/pointCloudView/hooks/useSingleBox';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\nimport BatchUpdateModal from './components/batchUpdateModal';\nimport { IFileItem } from '@/types/data';\nimport { PointCloudUtils } from '@labelbee/lb-utils';\nimport AttributeList from '@/components/attributeList';\nimport { IInputList } from '@/types/main';\nimport { useAttribute } from '@/components/pointCloudView/hooks/useAttribute';\n\ninterface IProps {\n stepInfo: IStepInfo;\n toolInstance: ICustomToolInstance; // Created by useCustomToolInstance.\n imgList: IFileItem[];\n imgIndex: number;\n}\n\n// Temporarily hidden, this feature does not support the function for the time being.\nconst AnnotatedBox = ({ imgList, imgIndex }: { imgList: IFileItem[]; imgIndex: number }) => {\n const ptCtx = useContext(PointCloudContext);\n const [showIDs, setShowIds] = useState<number[]>([]);\n const { t } = useTranslation();\n\n useEffect(() => {\n const newImgList = imgList as Array<{ result: string }>;\n let trackMap = new Map();\n setShowIds(\n PointCloudUtils.getAllPointCloudResult({\n imgList: newImgList,\n extraBoxList: pointCloudBoxList,\n ignoreIndexList: [imgIndex],\n })\n .filter((v) => {\n if (!v.trackID) {\n return false;\n }\n\n if (trackMap.get(v.trackID)) {\n return false;\n }\n trackMap.set(v.trackID, true);\n return true;\n })\n .sort((a, b) => {\n const aTrackID = a?.trackID ?? 0;\n const bTrackID = b?.trackID ?? 0;\n\n return aTrackID - bTrackID;\n })\n .map((v) => v?.trackID ?? 0),\n );\n }, [ptCtx.pointCloudBoxList, imgList]);\n\n const { pointCloudBoxList } = ptCtx;\n\n return (\n <div style={{ padding: 24, borderBottom: '1px solid #eee' }}>\n <div style={{ marginBottom: 16 }}>{t('AllTrackIDs')}</div>\n <div>\n {showIDs.map((id) => (\n <Tag color='#F3F4FF' key={id} style={{ color: '#666', marginBottom: 8 }}>\n {id}\n </Tag>\n ))}\n </div>\n </div>\n );\n};\n\nconst BoxTrackIDInput = () => {\n const [isEdit, setIsEdit] = useState(false);\n const { pointCloudBoxList } = useContext(PointCloudContext);\n const { selectedBox, updateSelectedBox } = useSingleBox();\n const [inputValue, setInputValue] = useState('');\n const { t } = useTranslation();\n\n const selectedBoxTrackID = selectedBox?.info.trackID;\n\n const hasDuplicateTrackID = (trackID: number) => {\n const duplicateBox = pointCloudBoxList.find(\n (v) => v.trackID === trackID && v.id !== selectedBox?.info.id,\n );\n return !!duplicateBox;\n };\n\n const applyInputValue = (isBlurEvent = false) => {\n const newTrackID = parseInt(inputValue, 10);\n\n if (isBlurEvent) {\n setIsEdit(false);\n }\n\n if (isNaN(newTrackID)) {\n message.error(t('PositiveIntegerCheck'));\n return;\n }\n\n if (inputValue.indexOf('.') > -1) {\n message.error(t('NotAllowDecimalPointsInTrackID'));\n return;\n }\n\n if (hasDuplicateTrackID(newTrackID)) {\n message.error(t('DuplicateTrackIDsExist'));\n return;\n }\n\n if (!(newTrackID > 0)) {\n message.error(t('PositiveIntegerCheck'));\n return;\n }\n\n updateSelectedBox({ trackID: newTrackID });\n };\n\n useEffect(() => {\n setIsEdit(false);\n }, [selectedBoxTrackID]);\n\n return (\n <div style={{ padding: 24 }}>\n <div\n style={{\n marginBottom: 16,\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n }}\n >\n <span>{t('CurrentBoxTrackIDs')}</span>\n {selectedBoxTrackID && <BatchUpdateModal id={selectedBoxTrackID} />}\n </div>\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n }}\n >\n {isEdit && selectedBoxTrackID ? (\n <Input\n defaultValue={selectedBoxTrackID}\n onChange={(e) => {\n setInputValue(e.target.value);\n }}\n disabled={!selectedBoxTrackID}\n size='small'\n onBlur={() => {\n applyInputValue();\n }}\n onPressEnter={() => {\n applyInputValue(true);\n }}\n />\n ) : (\n <span>{selectedBoxTrackID}</span>\n )}\n <EditFilled\n style={{\n color: '#999',\n marginLeft: 16,\n cursor: typeof selectedBoxTrackID !== 'undefined' ? 'pointer' : 'not-allowed',\n }}\n onClick={() => {\n if (selectedBoxTrackID) {\n setIsEdit(!isEdit);\n }\n }}\n />\n </div>\n </div>\n );\n};\n\nconst AttributeUpdater = ({\n attributeList,\n subAttributeList,\n toolInstance,\n}: {\n toolInstance: ICustomToolInstance;\n attributeList: any[]; // TODO\n subAttributeList: any[]; // TODO\n}) => {\n const { selectedBox } = useSingleBox();\n const ptx = useContext(PointCloudContext);\n const { t } = useTranslation();\n const { defaultAttribute } = useAttribute();\n\n const titleStyle = {\n fontWeight: 500,\n fontSize: 14,\n margin: '12px 0 8px 20px',\n };\n\n const subTitleStyle = {\n margin: '12px 20px 8px',\n fontSize: 14,\n fontWeight: 500,\n wordWrap: 'break-word' as any, // WordWrap Type ?\n };\n\n const setAttribute = (attribute: string) => {\n toolInstance.setDefaultAttribute(attribute);\n };\n\n const setSubAttribute = (key: string, value: string) => {\n toolInstance.setSubAttribute(key, value);\n };\n\n const list = attributeList.map((i: any) => ({\n label: i.key,\n value: i.value,\n color: i?.color,\n }));\n\n return (\n <div>\n <div style={titleStyle}>{t('Attribute')}</div>\n <AttributeList\n list={list}\n forbidDefault={true}\n selectedAttribute={defaultAttribute ?? ''}\n attributeChanged={(attribute: string) => setAttribute(attribute)}\n />\n <Divider style={{ margin: 0 }} />\n {selectedBox && (\n <>\n {subAttributeList.map(\n (subAttribute) =>\n subAttribute?.subSelected && (\n <div style={{ marginTop: 12 }} key={subAttribute.value}>\n <div style={subTitleStyle}>\n {t('SubAttribute')}-{subAttribute.key}\n </div>\n {subAttribute.subSelected?.length < 5 ? (\n <AttributeList\n list={subAttribute.subSelected.map((v: IInputList) => ({\n label: v.key,\n value: v.value,\n }))}\n selectedAttribute={\n ptx.selectedPointCloudBox?.subAttribute?.[subAttribute.value]\n }\n num='-'\n forbidColor={true}\n forbidDefault={true}\n attributeChanged={(value) => setSubAttribute(subAttribute.value, value)}\n style={{ marginBottom: 12 }}\n />\n ) : (\n <Select\n style={{ margin: '0px 21px 17px 16px', width: '87%' }}\n value={ptx.selectedPointCloudBox?.subAttribute?.[subAttribute.value]}\n placeholder={t('PleaseSelect')}\n onChange={(value) => setSubAttribute(subAttribute.value, value)}\n allowClear={true}\n >\n {subAttribute.subSelected.map((sub: any) => (\n <Select.Option key={sub.value} value={sub.value}>\n {sub.key}\n </Select.Option>\n ))}\n </Select>\n )}\n <Divider style={{ margin: 0 }} />\n </div>\n ),\n )}\n </>\n )}\n </div>\n );\n};\n\nconst PointCloudToolSidebar: React.FC<IProps> = ({ stepInfo, toolInstance, imgList, imgIndex }) => {\n const { updatePointCloudPattern, pointCloudPattern } = useStatus();\n\n const config = jsonParser(stepInfo.config);\n const attributeList = config?.attributeList ?? [];\n const subAttributeList =\n config?.secondaryAttributeConfigurable === true ? config?.inputList ?? [] : [];\n\n return (\n <>\n <ToolIcons\n toolName={cTool.EPointCloudName.PointCloud}\n selectedToolName={pointCloudPattern}\n onChange={(v) => updatePointCloudPattern?.(v)}\n />\n {config?.trackConfigurable === true && (\n <>\n <AnnotatedBox imgList={imgList} imgIndex={imgIndex} />\n <BoxTrackIDInput />\n <Divider style={{ margin: 0 }} />\n </>\n )}\n <AttributeUpdater\n toolInstance={toolInstance}\n attributeList={attributeList}\n subAttributeList={subAttributeList}\n />\n </>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n const stepInfo = StepUtils.getCurrentStepInfo(state.annotation?.step, state.annotation?.stepList);\n const toolInstance = state.annotation?.toolInstance;\n\n return {\n stepInfo,\n toolInstance,\n imgList: state.annotation.imgList,\n imgIndex: state.annotation.imgIndex,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudToolSidebar,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,MAAM,YAAe,GAAA,CAAC,CAAE,OAAA,EAAS,QAA2D,CAAA,KAAA;AAC1F,EAAA,MAAM,QAAQ,UAAW,CAAA,iBAAA,CAAA,CAAA;AACzB,EAAM,MAAA,CAAC,OAAS,EAAA,UAAA,CAAA,GAAc,QAAmB,CAAA,EAAA,CAAA,CAAA;AACjD,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AAEd,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,UAAa,GAAA,OAAA,CAAA;AACnB,IAAA,IAAI,WAAW,IAAI,GAAA,EAAA,CAAA;AACnB,IAAA,UAAA,CACE,gBAAgB,sBAAuB,CAAA;AAAA,MACrC,OAAS,EAAA,UAAA;AAAA,MACT,YAAc,EAAA,iBAAA;AAAA,MACd,iBAAiB,CAAC,QAAA,CAAA;AAAA,KAEjB,CAAA,CAAA,MAAA,CAAO,CAAC,CAAM,KAAA;AACb,MAAI,IAAA,CAAC,EAAE,OAAS,EAAA;AACd,QAAO,OAAA,KAAA,CAAA;AAAA,OAA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, { useContext, useState, useEffect } from 'react';\nimport { EditFilled } from '@ant-design/icons';\nimport { ToolIcons } from '../ToolIcons';\nimport { cTool } from '@labelbee/lb-annotation';\nimport { PointCloudContext } from '@/components/pointCloudView/PointCloudContext';\nimport { Select, Tag, message, Input, Divider } from 'antd';\nimport { AppState } from '@/store';\nimport StepUtils from '@/utils/StepUtils';\nimport { connect } from 'react-redux';\nimport { IStepInfo } from '@/types/step';\nimport { jsonParser } from '@/utils';\nimport { ICustomToolInstance } from '@/hooks/annotation';\nimport { useStatus } from '@/components/pointCloudView/hooks/useStatus';\nimport { useSingleBox } from '@/components/pointCloudView/hooks/useSingleBox';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\nimport BatchUpdateModal from './components/batchUpdateModal';\nimport { IFileItem } from '@/types/data';\nimport { PointCloudUtils } from '@labelbee/lb-utils';\nimport AttributeList from '@/components/attributeList';\nimport { IInputList } from '@/types/main';\nimport { useAttribute } from '@/components/pointCloudView/hooks/useAttribute';\n\ninterface IProps {\n stepInfo: IStepInfo;\n toolInstance: ICustomToolInstance; // Created by useCustomToolInstance.\n imgList: IFileItem[];\n imgIndex: number;\n}\n\n// Temporarily hidden, this feature does not support the function for the time being.\nconst AnnotatedBox = ({ imgList, imgIndex }: { imgList: IFileItem[]; imgIndex: number }) => {\n const ptCtx = useContext(PointCloudContext);\n const [showIDs, setShowIds] = useState<number[]>([]);\n const { t } = useTranslation();\n\n useEffect(() => {\n const newImgList = imgList as Array<{ result: string }>;\n let trackMap = new Map();\n setShowIds(\n PointCloudUtils.getAllPointCloudResult({\n imgList: newImgList,\n extraBoxList: pointCloudBoxList,\n ignoreIndexList: [imgIndex],\n })\n .filter((v) => {\n if (!v.trackID) {\n return false;\n }\n\n if (trackMap.get(v.trackID)) {\n return false;\n }\n trackMap.set(v.trackID, true);\n return true;\n })\n .sort((a, b) => {\n const aTrackID = a?.trackID ?? 0;\n const bTrackID = b?.trackID ?? 0;\n\n return aTrackID - bTrackID;\n })\n .map((v) => v?.trackID ?? 0),\n );\n }, [ptCtx.pointCloudBoxList, imgList]);\n\n const { pointCloudBoxList } = ptCtx;\n\n return (\n <div style={{ padding: 24, borderBottom: '1px solid #eee' }}>\n <div style={{ marginBottom: 16 }}>{t('AllTrackIDs')}</div>\n <div>\n {showIDs.map((id) => (\n <Tag color='#F3F4FF' key={id} style={{ color: '#666', marginBottom: 8 }}>\n {id}\n </Tag>\n ))}\n </div>\n </div>\n );\n};\n\nconst BoxTrackIDInput = () => {\n const [isEdit, setIsEdit] = useState(false);\n const { pointCloudBoxList } = useContext(PointCloudContext);\n const { selectedBox, updateSelectedBox } = useSingleBox();\n const [inputValue, setInputValue] = useState('');\n const { t } = useTranslation();\n\n const selectedBoxTrackID = selectedBox?.info.trackID;\n\n const hasDuplicateTrackID = (trackID: number) => {\n const duplicateBox = pointCloudBoxList.find(\n (v) => v.trackID === trackID && v.id !== selectedBox?.info.id,\n );\n return !!duplicateBox;\n };\n\n const applyInputValue = (isBlurEvent = false) => {\n const newTrackID = parseInt(inputValue, 10);\n\n if (isBlurEvent) {\n setIsEdit(false);\n }\n\n if (isNaN(newTrackID)) {\n message.error(t('PositiveIntegerCheck'));\n return;\n }\n\n if (inputValue.indexOf('.') > -1) {\n message.error(t('NotAllowDecimalPointsInTrackID'));\n return;\n }\n\n if (hasDuplicateTrackID(newTrackID)) {\n message.error(t('DuplicateTrackIDsExist'));\n return;\n }\n\n if (!(newTrackID > 0)) {\n message.error(t('PositiveIntegerCheck'));\n return;\n }\n\n updateSelectedBox({ trackID: newTrackID });\n };\n\n useEffect(() => {\n setIsEdit(false);\n }, [selectedBoxTrackID]);\n\n return (\n <div style={{ padding: 24 }}>\n <div\n style={{\n marginBottom: 16,\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n }}\n >\n <span>{t('CurrentBoxTrackIDs')}</span>\n {selectedBoxTrackID && <BatchUpdateModal id={selectedBoxTrackID} />}\n </div>\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n }}\n >\n {isEdit && selectedBoxTrackID ? (\n <Input\n defaultValue={selectedBoxTrackID}\n onChange={(e) => {\n setInputValue(e.target.value);\n }}\n disabled={!selectedBoxTrackID}\n size='small'\n onBlur={() => {\n applyInputValue();\n }}\n onPressEnter={() => {\n applyInputValue(true);\n }}\n />\n ) : (\n <span>{selectedBoxTrackID}</span>\n )}\n <EditFilled\n style={{\n color: '#999',\n marginLeft: 16,\n cursor: typeof selectedBoxTrackID !== 'undefined' ? 'pointer' : 'not-allowed',\n }}\n onClick={() => {\n if (selectedBoxTrackID) {\n setIsEdit(!isEdit);\n }\n }}\n />\n </div>\n </div>\n );\n};\n\nconst AttributeUpdater = ({\n attributeList,\n subAttributeList,\n toolInstance,\n}: {\n toolInstance: ICustomToolInstance;\n attributeList: any[]; // TODO\n subAttributeList: any[]; // TODO\n}) => {\n const { selectedBox } = useSingleBox();\n const ptx = useContext(PointCloudContext);\n const { t } = useTranslation();\n const { defaultAttribute } = useAttribute();\n\n const titleStyle = {\n fontWeight: 500,\n fontSize: 14,\n margin: '12px 0 8px 20px',\n };\n\n const subTitleStyle = {\n margin: '12px 20px 8px',\n fontSize: 14,\n fontWeight: 500,\n wordWrap: 'break-word' as any, // WordWrap Type ?\n };\n\n const setAttribute = (attribute: string) => {\n toolInstance.setDefaultAttribute(attribute);\n };\n\n const setSubAttribute = (key: string, value: string) => {\n toolInstance.setSubAttribute(key, value);\n };\n\n const list = attributeList.map((i: any) => ({\n label: i.key,\n value: i.value,\n color: i?.color,\n }));\n\n return (\n <div>\n <div style={titleStyle}>{t('Attribute')}</div>\n <AttributeList\n list={list}\n forbidDefault={true}\n selectedAttribute={defaultAttribute ?? ''}\n attributeChanged={(attribute: string) => setAttribute(attribute)}\n />\n <Divider style={{ margin: 0 }} />\n {selectedBox && (\n <>\n {subAttributeList.map(\n (subAttribute) =>\n subAttribute?.subSelected && (\n <div style={{ marginTop: 12 }} key={subAttribute.value}>\n <div style={subTitleStyle}>\n {t('SubAttribute')}-{subAttribute.key}\n </div>\n {subAttribute.subSelected?.length < 5 ? (\n <AttributeList\n list={subAttribute.subSelected.map((v: IInputList) => ({\n label: v.key,\n value: v.value,\n }))}\n selectedAttribute={\n ptx.selectedPointCloudBox?.subAttribute?.[subAttribute.value]\n }\n num='-'\n forbidColor={true}\n forbidDefault={true}\n attributeChanged={(value) => setSubAttribute(subAttribute.value, value)}\n style={{ marginBottom: 12 }}\n />\n ) : (\n <Select\n style={{ margin: '0px 21px 17px 16px', width: '87%' }}\n value={ptx.selectedPointCloudBox?.subAttribute?.[subAttribute.value]}\n placeholder={t('PleaseSelect')}\n onChange={(value) => setSubAttribute(subAttribute.value, value)}\n allowClear={true}\n >\n {subAttribute.subSelected.map((sub: any) => (\n <Select.Option key={sub.value} value={sub.value}>\n {sub.key}\n </Select.Option>\n ))}\n </Select>\n )}\n <Divider style={{ margin: 0 }} />\n </div>\n ),\n )}\n </>\n )}\n </div>\n );\n};\n\nconst PointCloudToolSidebar: React.FC<IProps> = ({ stepInfo, toolInstance, imgList, imgIndex }) => {\n const { updatePointCloudPattern, pointCloudPattern } = useStatus();\n\n const config = jsonParser(stepInfo.config);\n const attributeList = config?.attributeList ?? [];\n const subAttributeList =\n config?.secondaryAttributeConfigurable === true ? config?.inputList ?? [] : [];\n\n return (\n <>\n <ToolIcons\n toolName={cTool.EPointCloudName.PointCloud}\n selectedToolName={pointCloudPattern}\n onChange={(v) => updatePointCloudPattern?.(v)}\n />\n <AttributeUpdater\n toolInstance={toolInstance}\n attributeList={attributeList}\n subAttributeList={subAttributeList}\n />\n {config?.trackConfigurable === true && (\n <>\n <BoxTrackIDInput />\n <Divider style={{ margin: 0 }} />\n <AnnotatedBox imgList={imgList} imgIndex={imgIndex} />\n </>\n )}\n </>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n const stepInfo = StepUtils.getCurrentStepInfo(state.annotation?.step, state.annotation?.stepList);\n const toolInstance = state.annotation?.toolInstance;\n\n return {\n stepInfo,\n toolInstance,\n imgList: state.annotation.imgList,\n imgIndex: state.annotation.imgIndex,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudToolSidebar,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,MAAM,YAAe,GAAA,CAAC,CAAE,OAAA,EAAS,QAA2D,CAAA,KAAA;AAC1F,EAAA,MAAM,QAAQ,UAAW,CAAA,iBAAA,CAAA,CAAA;AACzB,EAAM,MAAA,CAAC,OAAS,EAAA,UAAA,CAAA,GAAc,QAAmB,CAAA,EAAA,CAAA,CAAA;AACjD,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AAEd,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,UAAa,GAAA,OAAA,CAAA;AACnB,IAAA,IAAI,WAAW,IAAI,GAAA,EAAA,CAAA;AACnB,IAAA,UAAA,CACE,gBAAgB,sBAAuB,CAAA;AAAA,MACrC,OAAS,EAAA,UAAA;AAAA,MACT,YAAc,EAAA,iBAAA;AAAA,MACd,iBAAiB,CAAC,QAAA,CAAA;AAAA,KAEjB,CAAA,CAAA,MAAA,CAAO,CAAC,CAAM,KAAA;AACb,MAAI,IAAA,CAAC,EAAE,OAAS,EAAA;AACd,QAAO,OAAA,KAAA,CAAA;AAAA,OAAA;AAGT,MAAI,IAAA,QAAA,CAAS,GAAI,CAAA,CAAA,CAAE,OAAU,CAAA,EAAA;AAC3B,QAAO,OAAA,KAAA,CAAA;AAAA,OAAA;AAET,MAAS,QAAA,CAAA,GAAA,CAAI,EAAE,OAAS,EAAA,IAAA,CAAA,CAAA;AACxB,MAAO,OAAA,IAAA,CAAA;AAAA,KAER,CAAA,CAAA,IAAA,CAAK,CAAC,CAAA,EAAG,CAAM,KAAA;AAxDxB,MAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAyDU,MAAM,MAAA,QAAA,GAAW,CAAG,EAAA,GAAA,CAAA,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EAAA,EAAA,EAAA,CAAA;AA+TE,EAAM,MAAA,QAAA,GAAW,UAAU,kBAAmB,CAAA,CAAA,EAAA,GAAA,KAAA,CAAM,eAAN,IAAkB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,EAAM,CAAM,EAAA,GAAA,KAAA,CAAA,UAAA,KAAN,IAAkB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,QAAA,CAAA,CAAA;AACxF,EAAM,MAAA,YAAA,GAAe,CAAM,EAAA,GAAA,KAAA,CAAA,UAAA,KAAN,IAAkB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,YAAA,CAAA;AAEvC,EAAO,OAAA;AAAA,IACL,QAAA;AAAA,IACA,YAAA;AAAA,IACA,OAAA,EAAS,MAAM,UAAW,CAAA,OAAA;AAAA,IAC1B,QAAA,EAAU,MAAM,UAAW,CAAA,QAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAI/B,8BAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC7D,CAAA,CAAA,CAAA,qBAAA,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1-alpha.0",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@ant-design/icons": "^4.6.2",
|
|
44
|
-
"@labelbee/lb-annotation": "^1.13.0
|
|
45
|
-
"@labelbee/lb-utils": "^1.6.0
|
|
44
|
+
"@labelbee/lb-annotation": "^1.13.0",
|
|
45
|
+
"@labelbee/lb-utils": "^1.6.0",
|
|
46
46
|
"ahooks": "^3.4.0",
|
|
47
47
|
"classnames": "^2.3.0",
|
|
48
48
|
"lodash": "^4.17.21",
|
|
@@ -96,6 +96,5 @@
|
|
|
96
96
|
"commitizen": {
|
|
97
97
|
"path": "node_modules/cz-conventional-changelog"
|
|
98
98
|
}
|
|
99
|
-
}
|
|
100
|
-
"gitHead": "95a39c945895bb420d8ab7485e7a49176dae2a76"
|
|
99
|
+
}
|
|
101
100
|
}
|
package/LICENSE
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
Copyright 2018-2023 OpenMMLab. All rights reserved.
|
|
2
|
-
|
|
3
|
-
Apache License
|
|
4
|
-
Version 2.0, January 2004
|
|
5
|
-
http://www.apache.org/licenses/
|
|
6
|
-
|
|
7
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
-
|
|
9
|
-
1. Definitions.
|
|
10
|
-
|
|
11
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
-
|
|
14
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
-
the copyright owner that is granting the License.
|
|
16
|
-
|
|
17
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
-
other entities that control, are controlled by, or are under common
|
|
19
|
-
control with that entity. For the purposes of this definition,
|
|
20
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
-
direction or management of such entity, whether by contract or
|
|
22
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
-
|
|
25
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
-
exercising permissions granted by this License.
|
|
27
|
-
|
|
28
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
-
including but not limited to software source code, documentation
|
|
30
|
-
source, and configuration files.
|
|
31
|
-
|
|
32
|
-
"Object" form shall mean any form resulting from mechanical
|
|
33
|
-
transformation or translation of a Source form, including but
|
|
34
|
-
not limited to compiled object code, generated documentation,
|
|
35
|
-
and conversions to other media types.
|
|
36
|
-
|
|
37
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
-
Object form, made available under the License, as indicated by a
|
|
39
|
-
copyright notice that is included in or attached to the work
|
|
40
|
-
(an example is provided in the Appendix below).
|
|
41
|
-
|
|
42
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
-
form, that is based on (or derived from) the Work and for which the
|
|
44
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
-
of this License, Derivative Works shall not include works that remain
|
|
47
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
-
the Work and Derivative Works thereof.
|
|
49
|
-
|
|
50
|
-
"Contribution" shall mean any work of authorship, including
|
|
51
|
-
the original version of the Work and any modifications or additions
|
|
52
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
-
means any form of electronic, verbal, or written communication sent
|
|
57
|
-
to the Licensor or its representatives, including but not limited to
|
|
58
|
-
communication on electronic mailing lists, source code control systems,
|
|
59
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
-
excluding communication that is conspicuously marked or otherwise
|
|
62
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
-
|
|
64
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
-
subsequently incorporated within the Work.
|
|
67
|
-
|
|
68
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
-
Work and such Derivative Works in Source or Object form.
|
|
74
|
-
|
|
75
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
-
(except as stated in this section) patent license to make, have made,
|
|
79
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
-
where such license applies only to those patent claims licensable
|
|
81
|
-
by such Contributor that are necessarily infringed by their
|
|
82
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
-
institute patent litigation against any entity (including a
|
|
85
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
-
or contributory patent infringement, then any patent licenses
|
|
88
|
-
granted to You under this License for that Work shall terminate
|
|
89
|
-
as of the date such litigation is filed.
|
|
90
|
-
|
|
91
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
-
modifications, and in Source or Object form, provided that You
|
|
94
|
-
meet the following conditions:
|
|
95
|
-
|
|
96
|
-
(a) You must give any other recipients of the Work or
|
|
97
|
-
Derivative Works a copy of this License; and
|
|
98
|
-
|
|
99
|
-
(b) You must cause any modified files to carry prominent notices
|
|
100
|
-
stating that You changed the files; and
|
|
101
|
-
|
|
102
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
-
that You distribute, all copyright, patent, trademark, and
|
|
104
|
-
attribution notices from the Source form of the Work,
|
|
105
|
-
excluding those notices that do not pertain to any part of
|
|
106
|
-
the Derivative Works; and
|
|
107
|
-
|
|
108
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
-
distribution, then any Derivative Works that You distribute must
|
|
110
|
-
include a readable copy of the attribution notices contained
|
|
111
|
-
within such NOTICE file, excluding those notices that do not
|
|
112
|
-
pertain to any part of the Derivative Works, in at least one
|
|
113
|
-
of the following places: within a NOTICE text file distributed
|
|
114
|
-
as part of the Derivative Works; within the Source form or
|
|
115
|
-
documentation, if provided along with the Derivative Works; or,
|
|
116
|
-
within a display generated by the Derivative Works, if and
|
|
117
|
-
wherever such third-party notices normally appear. The contents
|
|
118
|
-
of the NOTICE file are for informational purposes only and
|
|
119
|
-
do not modify the License. You may add Your own attribution
|
|
120
|
-
notices within Derivative Works that You distribute, alongside
|
|
121
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
-
that such additional attribution notices cannot be construed
|
|
123
|
-
as modifying the License.
|
|
124
|
-
|
|
125
|
-
You may add Your own copyright statement to Your modifications and
|
|
126
|
-
may provide additional or different license terms and conditions
|
|
127
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
-
the conditions stated in this License.
|
|
131
|
-
|
|
132
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
-
this License, without any additional terms or conditions.
|
|
136
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
-
the terms of any separate license agreement you may have executed
|
|
138
|
-
with Licensor regarding such Contributions.
|
|
139
|
-
|
|
140
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
-
except as required for reasonable and customary use in describing the
|
|
143
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
-
|
|
145
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
-
implied, including, without limitation, any warranties or conditions
|
|
150
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
-
appropriateness of using or redistributing the Work and assume any
|
|
153
|
-
risks associated with Your exercise of permissions under this License.
|
|
154
|
-
|
|
155
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
-
unless required by applicable law (such as deliberate and grossly
|
|
158
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
-
liable to You for damages, including any direct, indirect, special,
|
|
160
|
-
incidental, or consequential damages of any character arising as a
|
|
161
|
-
result of this License or out of the use or inability to use the
|
|
162
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
-
other commercial damages or losses), even if such Contributor
|
|
165
|
-
has been advised of the possibility of such damages.
|
|
166
|
-
|
|
167
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
-
or other liability obligations and/or rights consistent with this
|
|
171
|
-
License. However, in accepting such obligations, You may act only
|
|
172
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
-
defend, and hold each Contributor harmless for any liability
|
|
175
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
-
of your accepting any such warranty or additional liability.
|
|
177
|
-
|
|
178
|
-
END OF TERMS AND CONDITIONS
|
|
179
|
-
|
|
180
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
-
|
|
182
|
-
To apply the Apache License to your work, attach the following
|
|
183
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
-
replaced with your own identifying information. (Don't include
|
|
185
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
-
comment syntax for the file format. We also recommend that a
|
|
187
|
-
file or class name and description of purpose be included on the
|
|
188
|
-
same "printed page" as the copyright notice for easier
|
|
189
|
-
identification within third-party archives.
|
|
190
|
-
|
|
191
|
-
Copyright 2018-2023 OpenMMLab.
|
|
192
|
-
|
|
193
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
-
you may not use this file except in compliance with the License.
|
|
195
|
-
You may obtain a copy of the License at
|
|
196
|
-
|
|
197
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
-
|
|
199
|
-
Unless required by applicable law or agreed to in writing, software
|
|
200
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
-
See the License for the specific language governing permissions and
|
|
203
|
-
limitations under the License.
|