From fc69a0c366d76d91dfeb99c9953d5b07941fd4bc Mon Sep 17 00:00:00 2001 From: zhangyang Date: Tue, 22 Oct 2024 17:00:33 +0800 Subject: [PATCH 01/21] feat: Highlight the selected rectangular 3D view --- .../src/core/pointCloud/index.ts | 54 ++++++++++++++----- .../pointCloudAnnotationView.tsx | 2 +- .../pointCloudView/PointCloud3DView.tsx | 1 + .../hooks/usePointCloudViews.ts | 2 +- 4 files changed, 43 insertions(+), 16 deletions(-) diff --git a/packages/lb-annotation/src/core/pointCloud/index.ts b/packages/lb-annotation/src/core/pointCloud/index.ts index 0c2416751..50ed0faf6 100644 --- a/packages/lb-annotation/src/core/pointCloud/index.ts +++ b/packages/lb-annotation/src/core/pointCloud/index.ts @@ -165,6 +165,8 @@ export class PointCloud extends EventListener { private filterBoxWorkerTimer: ReturnType | null = null; + private highlightColor = 0xffff00; + constructor({ container, noAppend, @@ -244,18 +246,44 @@ export class PointCloud extends EventListener { child.children.forEach((grandson) => { if (grandson instanceof THREE.Mesh) { clickMeshes.push(grandson); + } else { + this.updateMaterialColor(grandson, child.userData.defaultColor); } }); }); const intersects = this.raycaster.intersectObjects(clickMeshes, false); if (intersects.length > 0) { - const intersectedObject = intersects[0].object; + const parentGroup = intersects[0].object.parent; + // Find the BoxHelper and change the color + parentGroup?.children.forEach((child) => { + this.updateMaterialColor(child, this.highlightColor); + }); this.pipe?.setNeedUpdateCenter(false); - this.pipe?.setSelectedIDs(intersectedObject.userData.selectedID); + this.pipe?.setSelectedIDs(parentGroup?.userData.selectedID); } else { this.pipe?.setSelectedIDs(undefined); } + this.render(); + }); + } + + public setHighlightColor(selectedId: string) { + this.scene.children.forEach((child) => { + if (!(child instanceof THREE.Group)) return; + const color = child.name === `box${selectedId}` ? this.highlightColor : child.userData.defaultColor; + child.children.forEach((grandson) => { + this.updateMaterialColor(grandson, color); + }); }); + this.render(); + } + + private updateMaterialColor(child: THREE.Object3D, color: THREE.ColorRepresentation) { + if (child instanceof THREE.BoxHelper) { + (child.material as THREE.LineBasicMaterial).color.set(color); + } else if (child instanceof THREE.Sprite) { + (child.material as THREE.SpriteMaterial).color.set(color); + } } public setHandlerPipe(pipe: IPipeTypes) { @@ -598,13 +626,13 @@ export class PointCloud extends EventListener { const arrow = this.generateBoxArrow(boxParams); // Temporarily hide - const boxID = this.generateBoxTrackID(boxParams); + const boxID = this.generateBoxTrackID(boxParams, color); if (boxID) { group.add(boxID); } // 生成并添加attribute标签 - const attributeLabel = this.generateBoxAttributeLabel(boxParams); + const attributeLabel = this.generateBoxAttributeLabel(boxParams, color); if (attributeLabel) { group.add(attributeLabel); } @@ -621,9 +649,8 @@ export class PointCloud extends EventListener { const clickGeometry = new THREE.BoxGeometry(width, height, depth); const clickMaterial = new THREE.MeshBasicMaterial({ visible: false }); const clickMesh = new THREE.Mesh(clickGeometry, clickMaterial); - clickMesh.userData = { selectedID: id }; group.add(clickMesh); - + group.userData = { defaultColor: color, selectedID: id }; this.scene.add(group); }; @@ -1397,8 +1424,7 @@ export class PointCloud extends EventListener { const dir = new THREE.Vector3(1, 0, 0); const origin = new THREE.Vector3(width / 2, 0, 0); const arrowLen = 2; - const hex = 0xffff00; - const arrowHelper = new THREE.ArrowHelper(dir, origin, arrowLen, hex); + const arrowHelper = new THREE.ArrowHelper(dir, origin, arrowLen, this.highlightColor); arrowHelper.visible = this.showDirection; return arrowHelper; @@ -1410,7 +1436,7 @@ export class PointCloud extends EventListener { * @param scaleFactor scale size * @returns { sprite, canvasWidth, canvasHeight } */ - public generateLabel = (text: string, scaleFactor: number) => { + public generateLabel = (text: string, scaleFactor: number, color: THREE.ColorRepresentation) => { const canvas = this.getTextCanvas(text); const texture = new THREE.Texture(canvas); @@ -1423,7 +1449,7 @@ export class PointCloud extends EventListener { const canvasWidth = canvas.width / window.devicePixelRatio; const canvasHeight = canvas.height / window.devicePixelRatio; - const spriteMaterial = new THREE.SpriteMaterial({ map: texture, depthWrite: false }); + const spriteMaterial = new THREE.SpriteMaterial({ map: texture, depthWrite: false, color }); const sprite = new THREE.Sprite(spriteMaterial); sprite.scale.set(canvasWidth / scaleFactor, canvasHeight / scaleFactor, 1); @@ -1435,10 +1461,10 @@ export class PointCloud extends EventListener { * @param boxParams * @returns sprite */ - public generateBoxTrackID = (boxParams: IPointCloudBox) => { + public generateBoxTrackID = (boxParams: IPointCloudBox, color: THREE.ColorRepresentation) => { if (!boxParams.trackID) return; - const { sprite } = this.generateLabel(boxParams.trackID.toString(), 50); + const { sprite } = this.generateLabel(boxParams.trackID.toString(), 50, color); sprite.position.set(-boxParams.width / 2, 0, boxParams.depth / 2 + 0.5); @@ -1450,13 +1476,13 @@ export class PointCloud extends EventListener { * @param boxParams * @returns sprite */ - public generateBoxAttributeLabel = (boxParams: IPointCloudBox) => { + public generateBoxAttributeLabel = (boxParams: IPointCloudBox, color: THREE.ColorRepresentation) => { if (!boxParams.attribute || this.hiddenText) return; const classLabel = this.findSubAttributeLabel(boxParams, this.config); const subAttributeLabel = classLabel ? `${boxParams.attribute}\n${classLabel}` : `${boxParams.attribute}`; - const { sprite, canvasHeight } = this.generateLabel(subAttributeLabel, 100); + const { sprite, canvasHeight } = this.generateLabel(subAttributeLabel, 100, color); sprite.position.set(-boxParams.width / 2, 0, -boxParams.depth / 2 - canvasHeight / 150); diff --git a/packages/lb-components/src/components/AnnotationView/pointCloudAnnotationView.tsx b/packages/lb-components/src/components/AnnotationView/pointCloudAnnotationView.tsx index ea1ccc91f..e64f39acb 100644 --- a/packages/lb-components/src/components/AnnotationView/pointCloudAnnotationView.tsx +++ b/packages/lb-components/src/components/AnnotationView/pointCloudAnnotationView.tsx @@ -85,7 +85,7 @@ const PointCloudAnnotationView = (props: IProps) => { // Add Init Box boxParamsList.forEach((v: IPointCloudBox) => { - instance.current?.generateBox(v, v.id); + instance.current?.generateBox(v); }); } return () => { diff --git a/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx b/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx index 33a4975c0..bf5e79bba 100644 --- a/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx +++ b/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx @@ -250,6 +250,7 @@ const PointCloud3D: React.FC = ({ currentData, config, highlig */ const zoom = ptCtx.topViewInstance?.pointCloudInstance?.camera.zoom ?? 1; ptCtx.mainViewInstance?.updateCameraZoom(zoom); + ptCtx.mainViewInstance?.setHighlightColor(selectedId); } }, [selectedBox?.info?.id]); diff --git a/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts b/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts index ea9aa61f1..2b366dd4d 100644 --- a/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts +++ b/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts @@ -580,7 +580,7 @@ export const synchronizeTopView = ( } // Control the 3D view data to create box - mainViewInstance.generateBox(newBoxParams, newPolygon.id); + mainViewInstance.generateBox(newBoxParams); mainViewInstance.render(); const { pointCloud2dOperation, pointCloudInstance } = topViewInstance; From a0417cea61c1ab3db50512ea672c4d52e2bdbfbc Mon Sep 17 00:00:00 2001 From: zhangyang Date: Mon, 21 Oct 2024 14:08:32 +0800 Subject: [PATCH 02/21] feat: Auto center and zoom 2D view after adding new elements --- .../pointCloud2DRectOperationView/index.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/lb-components/src/components/pointCloud2DRectOperationView/index.tsx b/packages/lb-components/src/components/pointCloud2DRectOperationView/index.tsx index 5ca9d2434..8e6036aa7 100644 --- a/packages/lb-components/src/components/pointCloud2DRectOperationView/index.tsx +++ b/packages/lb-components/src/components/pointCloud2DRectOperationView/index.tsx @@ -20,6 +20,7 @@ import { IPointCloudBoxRect, IPointCloud2DRectOperationViewRect, IPointCloudBox, + ImgPosUtils } from '@labelbee/lb-utils'; import { selectSpecifiedRectsFromTopViewSelectedIds } from './util'; import { useUpdateRectList } from './useUpdateRectList'; @@ -417,20 +418,17 @@ const PointCloud2DRectOperationView = (props: IPointCloud2DRectOperationViewProp setNeedUpdateCenter(true); return; } - const { rectList, size, zoom } = operation.current; + const { rectList, size, zoom, imgNode } = operation.current; // Use boxId for a normal connection, and use extId when disconnected. const rect = rectList.find((el: any) => el.boxID === selectedID || el.extId === selectedID); - if (!rect) { + const pos = ImgPosUtils.getBasicRecPos(imgNode, rect, size, 0.5); + if (!pos) { setNeedUpdateCenter(true); return; } - const centerPoint = { - x: rect.x + rect.width / 2, - y: rect.y + rect.height / 2, - }; - const currentPos = MathUtils.getCurrentPosFromRectCenter(size, centerPoint, zoom); operation.current.setHoverRectID(rect.id); - operation.current.setCurrentPos(currentPos); + operation.current.setCurrentPos(pos.currentPos); + operation.current.setZoom(pos.innerZoom); operation.current.renderBasicCanvas(); operation.current.render(); }, From 1e6a2aa33fedeb5b3bee5834145b29311a8db3fb Mon Sep 17 00:00:00 2001 From: zhangyang Date: Wed, 23 Oct 2024 10:04:59 +0800 Subject: [PATCH 03/21] feat: Auto center and zoom 2D view after adding new elements --- .../pointCloud2DRectOperationView/index.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/lb-components/src/components/pointCloud2DRectOperationView/index.tsx b/packages/lb-components/src/components/pointCloud2DRectOperationView/index.tsx index 8e6036aa7..285e53ccd 100644 --- a/packages/lb-components/src/components/pointCloud2DRectOperationView/index.tsx +++ b/packages/lb-components/src/components/pointCloud2DRectOperationView/index.tsx @@ -20,7 +20,7 @@ import { IPointCloudBoxRect, IPointCloud2DRectOperationViewRect, IPointCloudBox, - ImgPosUtils + ImgPosUtils, } from '@labelbee/lb-utils'; import { selectSpecifiedRectsFromTopViewSelectedIds } from './util'; import { useUpdateRectList } from './useUpdateRectList'; @@ -416,6 +416,11 @@ const PointCloud2DRectOperationView = (props: IPointCloud2DRectOperationViewProp // Center the view by selectedID if (!selectedID || !needUpdateCenter) { setNeedUpdateCenter(true); + // during disconnection + if (shouldExcludePointCloudBoxListUpdate) { + operation.current.setHoverRectID(''); + operation.current.render(); + } return; } const { rectList, size, zoom, imgNode } = operation.current; @@ -426,7 +431,10 @@ const PointCloud2DRectOperationView = (props: IPointCloud2DRectOperationViewProp setNeedUpdateCenter(true); return; } - operation.current.setHoverRectID(rect.id); + // during disconnection + if (shouldExcludePointCloudBoxListUpdate) { + operation.current.setHoverRectID(rect.id); + } operation.current.setCurrentPos(pos.currentPos); operation.current.setZoom(pos.innerZoom); operation.current.renderBasicCanvas(); From eb763acbf353cb4e1e2d893c9d0629dde4326132 Mon Sep 17 00:00:00 2001 From: "lixinghua.vendor" Date: Wed, 23 Oct 2024 15:22:09 +0800 Subject: [PATCH 04/21] fix: LLMMulitWheel tool style adjustment --- .../components/LLMMultiWheelView/index.tsx | 1 + .../MainView/LLMMultiWheelLayout/index.tsx | 20 +++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/lb-components/src/components/LLMMultiWheelView/index.tsx b/packages/lb-components/src/components/LLMMultiWheelView/index.tsx index 96e83d5ff..533db51e4 100644 --- a/packages/lb-components/src/components/LLMMultiWheelView/index.tsx +++ b/packages/lb-components/src/components/LLMMultiWheelView/index.tsx @@ -49,6 +49,7 @@ export const LLMMultiWheelSourceView: React.FC = style={{ display: 'flex', justifyContent: 'flex-end', + margin: '10px', }} > = (props) => { /> - - - {props.drawLayerSlot?.({})} - + + + + {props.drawLayerSlot?.({})} + + ); }; From b7daac52340f75cb90bd7c99442da4f0cbf870ea Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 24 Oct 2024 06:25:02 +0000 Subject: [PATCH 05/21] chore(release): 1.28.0-alpha.1 [skip ci] # @labelbee/lb-annotation [1.28.0-alpha.1](https://github.com/open-mmlab/labelbee/compare/@labelbee/lb-annotation@1.27.0...@labelbee/lb-annotation@1.28.0-alpha.1) (2024-10-24) ### Features * Highlight the selected rectangular 3D view ([fc69a0c](https://github.com/open-mmlab/labelbee/commit/fc69a0c366d76d91dfeb99c9953d5b07941fd4bc)) --- packages/lb-annotation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lb-annotation/package.json b/packages/lb-annotation/package.json index ecce5adc9..59a1be928 100644 --- a/packages/lb-annotation/package.json +++ b/packages/lb-annotation/package.json @@ -1,6 +1,6 @@ { "name": "@labelbee/lb-annotation", - "version": "1.27.0", + "version": "1.28.0-alpha.1", "description": "Annotation tool collection", "keywords": [ "annotation", From fd6f60daac8996d4f22726a0b6aadbf0dd7667c4 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 24 Oct 2024 06:25:07 +0000 Subject: [PATCH 06/21] chore(release): 1.24.0-alpha.1 [skip ci] # [1.24.0-alpha.1](https://github.com/open-mmlab/labelbee/compare/@labelbee/lb-components@1.23.1-alpha.3...@labelbee/lb-components@1.24.0-alpha.1) (2024-10-24) ### Features * Highlight the selected rectangular 3D view ([fc69a0c](https://github.com/open-mmlab/labelbee/commit/fc69a0c366d76d91dfeb99c9953d5b07941fd4bc)) --- packages/lb-components/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lb-components/package.json b/packages/lb-components/package.json index 1422d63fe..239f1f835 100644 --- a/packages/lb-components/package.json +++ b/packages/lb-components/package.json @@ -1,6 +1,6 @@ { "name": "@labelbee/lb-components", - "version": "1.23.1-alpha.3", + "version": "1.24.0-alpha.1", "description": "Provide a complete library of annotation components", "main": "./dist/index.js", "es": "./es/index.js", @@ -43,7 +43,7 @@ }, "dependencies": { "@ant-design/icons": "^4.6.2", - "@labelbee/lb-annotation": "1.27.0", + "@labelbee/lb-annotation": "1.28.0-alpha.1", "@labelbee/lb-utils": "1.19.0", "@labelbee/wavesurfer": "1.1.0", "@types/react-dom": "^18.2.7", From d8f539e31b25ca46656199b6f5407f4a4bca1f1e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 24 Oct 2024 06:39:09 +0000 Subject: [PATCH 07/21] chore(release): 1.24.0-alpha.2 [skip ci] # @labelbee/lb-components [1.24.0-alpha.2](https://github.com/open-mmlab/labelbee/compare/@labelbee/lb-components@1.24.0-alpha.1...@labelbee/lb-components@1.24.0-alpha.2) (2024-10-24) ### Features * Auto center and zoom 2D view after adding new elements ([1e6a2aa](https://github.com/open-mmlab/labelbee/commit/1e6a2aa33fedeb5b3bee5834145b29311a8db3fb)) * Auto center and zoom 2D view after adding new elements ([a0417ce](https://github.com/open-mmlab/labelbee/commit/a0417cea61c1ab3db50512ea672c4d52e2bdbfbc)) --- packages/lb-components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lb-components/package.json b/packages/lb-components/package.json index 239f1f835..e5a1a8fc5 100644 --- a/packages/lb-components/package.json +++ b/packages/lb-components/package.json @@ -1,6 +1,6 @@ { "name": "@labelbee/lb-components", - "version": "1.24.0-alpha.1", + "version": "1.24.0-alpha.2", "description": "Provide a complete library of annotation components", "main": "./dist/index.js", "es": "./es/index.js", From 50ab2c1bd36d5fcf8d32c1ff6e1d17b7c25796a8 Mon Sep 17 00:00:00 2001 From: zhangyang Date: Fri, 25 Oct 2024 10:10:16 +0800 Subject: [PATCH 08/21] fix: Fixed 3D view highlightColor issue --- packages/lb-annotation/src/core/pointCloud/index.ts | 4 ++-- .../src/components/pointCloudView/PointCloud3DView.tsx | 5 ++++- .../src/components/pointCloudView/PointCloudListener.tsx | 1 + .../pointCloudView/hooks/useUpdatePointCloudColor.ts | 6 +++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/lb-annotation/src/core/pointCloud/index.ts b/packages/lb-annotation/src/core/pointCloud/index.ts index 50ed0faf6..5d7d2dcfc 100644 --- a/packages/lb-annotation/src/core/pointCloud/index.ts +++ b/packages/lb-annotation/src/core/pointCloud/index.ts @@ -267,10 +267,10 @@ export class PointCloud extends EventListener { }); } - public setHighlightColor(selectedId: string) { + public setHighlightColor(selectedId?: string) { this.scene.children.forEach((child) => { if (!(child instanceof THREE.Group)) return; - const color = child.name === `box${selectedId}` ? this.highlightColor : child.userData.defaultColor; + const color = selectedId && child.name === `box${selectedId}` ? this.highlightColor : child.userData.defaultColor; child.children.forEach((grandson) => { this.updateMaterialColor(grandson, color); }); diff --git a/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx b/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx index bf5e79bba..8c780b68b 100644 --- a/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx +++ b/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx @@ -250,8 +250,11 @@ const PointCloud3D: React.FC = ({ currentData, config, highlig */ const zoom = ptCtx.topViewInstance?.pointCloudInstance?.camera.zoom ?? 1; ptCtx.mainViewInstance?.updateCameraZoom(zoom); - ptCtx.mainViewInstance?.setHighlightColor(selectedId); } + // when create new box, need to wait for a moment to init box. + setTimeout(() => { + ptCtx.mainViewInstance?.setHighlightColor(selectedId); + }, 100); }, [selectedBox?.info?.id]); useEffect(() => { diff --git a/packages/lb-components/src/components/pointCloudView/PointCloudListener.tsx b/packages/lb-components/src/components/pointCloudView/PointCloudListener.tsx index facacdabc..08825aa14 100644 --- a/packages/lb-components/src/components/pointCloudView/PointCloudListener.tsx +++ b/packages/lb-components/src/components/pointCloudView/PointCloudListener.tsx @@ -322,6 +322,7 @@ const PointCloudListener: React.FC = ({ updateSelectedBox(selectBox); if (ptCtx.mainViewInstance && ptCtx.selectedPointCloudBox) { ptCtx.mainViewInstance.generateBox(ptCtx.selectedPointCloudBox); + ptCtx.mainViewInstance.setHighlightColor(selectBox.id); } } }; diff --git a/packages/lb-components/src/components/pointCloudView/hooks/useUpdatePointCloudColor.ts b/packages/lb-components/src/components/pointCloudView/hooks/useUpdatePointCloudColor.ts index 4f81f2f76..3dbb52297 100644 --- a/packages/lb-components/src/components/pointCloudView/hooks/useUpdatePointCloudColor.ts +++ b/packages/lb-components/src/components/pointCloudView/hooks/useUpdatePointCloudColor.ts @@ -125,14 +125,18 @@ const useUpdatePointCloudColor = (setResourceLoading: any, config: any) => { * Update the relevant content of the original point cloud again * This method maintains the same judgment logic as the original topViewSlectedChanged, and only triggers an update when one box is selected */ + let newSelectedBox; if (selectedIDs && selectedIDs.length === 1) { - const newSelectedBox = pointCloudBoxList.find((item) => item.id === selectedIDs[0]); + newSelectedBox = pointCloudBoxList.find((item) => item.id === selectedIDs[0]); topViewSelectedChanged({ trigger, newSelectedBox, }); } mainViewInstance.generateBoxes(pointCloudBoxList); + if (newSelectedBox) { + mainViewInstance.setHighlightColor(newSelectedBox.id); + } } /** From a279f0647131ad158b282897e563857ba771e7c5 Mon Sep 17 00:00:00 2001 From: zhangyang Date: Fri, 25 Oct 2024 11:14:26 +0800 Subject: [PATCH 09/21] fix: Fixed 3D view highlightColor issue --- packages/lb-annotation/src/core/pointCloud/index.ts | 1 - .../src/components/pointCloudView/PointCloud3DView.tsx | 6 +++--- .../src/components/pointCloudView/PointCloudListener.tsx | 1 + .../components/pointCloudView/hooks/usePointCloudViews.ts | 1 + .../pointCloudView/hooks/useUpdatePointCloudColor.ts | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/lb-annotation/src/core/pointCloud/index.ts b/packages/lb-annotation/src/core/pointCloud/index.ts index 5d7d2dcfc..e11da6e25 100644 --- a/packages/lb-annotation/src/core/pointCloud/index.ts +++ b/packages/lb-annotation/src/core/pointCloud/index.ts @@ -275,7 +275,6 @@ export class PointCloud extends EventListener { this.updateMaterialColor(grandson, color); }); }); - this.render(); } private updateMaterialColor(child: THREE.Object3D, color: THREE.ColorRepresentation) { diff --git a/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx b/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx index 8c780b68b..ae3a0e814 100644 --- a/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx +++ b/packages/lb-components/src/components/pointCloudView/PointCloud3DView.tsx @@ -252,9 +252,9 @@ const PointCloud3D: React.FC = ({ currentData, config, highlig ptCtx.mainViewInstance?.updateCameraZoom(zoom); } // when create new box, need to wait for a moment to init box. - setTimeout(() => { - ptCtx.mainViewInstance?.setHighlightColor(selectedId); - }, 100); + ptCtx.mainViewInstance?.setHighlightColor(selectedId); + ptCtx.mainViewInstance?.render(); + }, [selectedBox?.info?.id]); useEffect(() => { diff --git a/packages/lb-components/src/components/pointCloudView/PointCloudListener.tsx b/packages/lb-components/src/components/pointCloudView/PointCloudListener.tsx index 08825aa14..7ab0e4a9a 100644 --- a/packages/lb-components/src/components/pointCloudView/PointCloudListener.tsx +++ b/packages/lb-components/src/components/pointCloudView/PointCloudListener.tsx @@ -323,6 +323,7 @@ const PointCloudListener: React.FC = ({ if (ptCtx.mainViewInstance && ptCtx.selectedPointCloudBox) { ptCtx.mainViewInstance.generateBox(ptCtx.selectedPointCloudBox); ptCtx.mainViewInstance.setHighlightColor(selectBox.id); + ptCtx.mainViewInstance.render(); } } }; diff --git a/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts b/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts index 2b366dd4d..870e830f8 100644 --- a/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts +++ b/packages/lb-components/src/components/pointCloudView/hooks/usePointCloudViews.ts @@ -581,6 +581,7 @@ export const synchronizeTopView = ( // Control the 3D view data to create box mainViewInstance.generateBox(newBoxParams); + mainViewInstance.setHighlightColor(newBoxParams.id); mainViewInstance.render(); const { pointCloud2dOperation, pointCloudInstance } = topViewInstance; diff --git a/packages/lb-components/src/components/pointCloudView/hooks/useUpdatePointCloudColor.ts b/packages/lb-components/src/components/pointCloudView/hooks/useUpdatePointCloudColor.ts index 3dbb52297..260f187eb 100644 --- a/packages/lb-components/src/components/pointCloudView/hooks/useUpdatePointCloudColor.ts +++ b/packages/lb-components/src/components/pointCloudView/hooks/useUpdatePointCloudColor.ts @@ -136,6 +136,7 @@ const useUpdatePointCloudColor = (setResourceLoading: any, config: any) => { mainViewInstance.generateBoxes(pointCloudBoxList); if (newSelectedBox) { mainViewInstance.setHighlightColor(newSelectedBox.id); + mainViewInstance.render(); } } From c9f7b87c3323e1ef92b582417aee487afee36667 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 25 Oct 2024 03:27:09 +0000 Subject: [PATCH 10/21] chore(release): 1.28.0-alpha.2 [skip ci] # @labelbee/lb-annotation [1.28.0-alpha.2](https://github.com/open-mmlab/labelbee/compare/@labelbee/lb-annotation@1.28.0-alpha.1...@labelbee/lb-annotation@1.28.0-alpha.2) (2024-10-25) ### Bug Fixes * Fixed 3D view highlightColor issue ([a279f06](https://github.com/open-mmlab/labelbee/commit/a279f0647131ad158b282897e563857ba771e7c5)) * Fixed 3D view highlightColor issue ([50ab2c1](https://github.com/open-mmlab/labelbee/commit/50ab2c1bd36d5fcf8d32c1ff6e1d17b7c25796a8)) --- packages/lb-annotation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lb-annotation/package.json b/packages/lb-annotation/package.json index 59a1be928..d74b2053a 100644 --- a/packages/lb-annotation/package.json +++ b/packages/lb-annotation/package.json @@ -1,6 +1,6 @@ { "name": "@labelbee/lb-annotation", - "version": "1.28.0-alpha.1", + "version": "1.28.0-alpha.2", "description": "Annotation tool collection", "keywords": [ "annotation", From 24f480a57f7cf11da3a2a3a3b7c6acf661701c02 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 25 Oct 2024 03:27:12 +0000 Subject: [PATCH 11/21] chore(release): 1.24.0-alpha.3 [skip ci] # [1.24.0-alpha.3](https://github.com/open-mmlab/labelbee/compare/@labelbee/lb-components@1.24.0-alpha.2...@labelbee/lb-components@1.24.0-alpha.3) (2024-10-25) ### Bug Fixes * Fixed 3D view highlightColor issue ([a279f06](https://github.com/open-mmlab/labelbee/commit/a279f0647131ad158b282897e563857ba771e7c5)) * Fixed 3D view highlightColor issue ([50ab2c1](https://github.com/open-mmlab/labelbee/commit/50ab2c1bd36d5fcf8d32c1ff6e1d17b7c25796a8)) --- packages/lb-components/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lb-components/package.json b/packages/lb-components/package.json index e5a1a8fc5..2b38610f4 100644 --- a/packages/lb-components/package.json +++ b/packages/lb-components/package.json @@ -1,6 +1,6 @@ { "name": "@labelbee/lb-components", - "version": "1.24.0-alpha.2", + "version": "1.24.0-alpha.3", "description": "Provide a complete library of annotation components", "main": "./dist/index.js", "es": "./es/index.js", @@ -43,7 +43,7 @@ }, "dependencies": { "@ant-design/icons": "^4.6.2", - "@labelbee/lb-annotation": "1.28.0-alpha.1", + "@labelbee/lb-annotation": "1.28.0-alpha.2", "@labelbee/lb-utils": "1.19.0", "@labelbee/wavesurfer": "1.1.0", "@types/react-dom": "^18.2.7", From fe3ec3d3dc0491a2c96102398117a645dc7226ab Mon Sep 17 00:00:00 2001 From: "lixinghua.vendor" Date: Tue, 29 Oct 2024 10:25:22 +0800 Subject: [PATCH 12/21] fix: Audio tool view mode optimization --- .../src/components/audioAnnotate/index.tsx | 38 +-- .../audioAnnotate/textInput/index.module.scss | 31 +- .../audioAnnotate/textInput/index.tsx | 322 ++++++++++-------- .../src/components/audioPlayer/index.tsx | 1 + 4 files changed, 220 insertions(+), 172 deletions(-) diff --git a/packages/lb-components/src/components/audioAnnotate/index.tsx b/packages/lb-components/src/components/audioAnnotate/index.tsx index 1fa8fcec3..e4f4fae51 100644 --- a/packages/lb-components/src/components/audioAnnotate/index.tsx +++ b/packages/lb-components/src/components/audioAnnotate/index.tsx @@ -111,27 +111,23 @@ const AudioTextToolTextarea = ({ clipTextList, }: any) => { return ( -
-
- -
-
+ ); }; diff --git a/packages/lb-components/src/components/audioAnnotate/textInput/index.module.scss b/packages/lb-components/src/components/audioAnnotate/textInput/index.module.scss index 0a9f5b4ca..39bd40fe3 100644 --- a/packages/lb-components/src/components/audioAnnotate/textInput/index.module.scss +++ b/packages/lb-components/src/components/audioAnnotate/textInput/index.module.scss @@ -23,13 +23,13 @@ @include fontStyle; font-size: 14px; - .labelText{ + .labelText { display: flex; overflow: hidden; width: 60%; align-items: center; - .titleText{ + .titleText { max-width: calc(100% - 20px); overflow: hidden; } @@ -44,6 +44,7 @@ line-height: 1; content: '*'; } + .extra { float: right; margin-right: 5px; @@ -67,7 +68,7 @@ font-size: 12px; opacity: 1; - > span { + >span { line-height: 16px; } @@ -150,25 +151,30 @@ .placeholderHotkey { padding: 20px; border-bottom: 1px solid #eee; + .title { margin-bottom: 8px; color: #333; font-size: 12px; } + .questionIcon { margin-left: 8px; color: #999; cursor: pointer; + &:hover { color: #666fff; } } + :global { .ant-radio-group { display: flex; justify-content: space-between; width: 100%; } + .ant-radio-button-wrapper { width: 60px; height: 60px; @@ -178,18 +184,22 @@ background: #fff; border: 1px solid #ccc !important; border-radius: 2px; + &:hover { box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.08); } + &.ant-radio-button-wrapper-checked { .text { color: #666fff; } } + &::before { display: none; } } + .label { display: flex; flex-wrap: wrap; @@ -197,9 +207,11 @@ justify-content: center; overflow: hidden; } + .text { color: #333; } + .hotkey { width: 44px; height: 20px; @@ -234,3 +246,16 @@ cursor: not-allowed; } } + + +.textInputBox { + flex: 1; + overflow: scroll; + text-align: center; + .textInputChild{ + + display: inline-block; + width: 65%; + } + +} diff --git a/packages/lb-components/src/components/audioAnnotate/textInput/index.tsx b/packages/lb-components/src/components/audioAnnotate/textInput/index.tsx index ba0841fb4..0f9043a18 100644 --- a/packages/lb-components/src/components/audioAnnotate/textInput/index.tsx +++ b/packages/lb-components/src/components/audioAnnotate/textInput/index.tsx @@ -1,5 +1,5 @@ import React, { FocusEvent, useEffect, useMemo, useRef, useState } from 'react'; -import { Radio, Switch, Tooltip } from 'antd'; +import { Radio, Spin, Switch, Tooltip } from 'antd'; import { QuestionCircleOutlined } from '@ant-design/icons'; import { TextareaWithFooter } from '@/views/MainView/sidebar/TextToolSidebar'; import { @@ -297,6 +297,9 @@ const TextInput = (props: IProps) => { const [focusIndex, setFocusIndex] = useState(0); const [placeholder, setPlaceholder] = useState(''); const placeholderTimer = useRef(null); + const containerRef = useRef(null); + const [visibleCount, setVisibleCount] = useState(5); // Initial load + const [lazyLoading, setLazyLoading] = useState(false); const { audioClipState } = useAudioClipStore(); const configList = dataList || [{ ...DEFAULT_TEXT_CONFIG_ITEM }]; let regionsList = regions; @@ -398,163 +401,186 @@ const TextInput = (props: IProps) => { ); }, [clipTextList, regionsList]); + const handleScroll = () => { + const container = containerRef.current; + + if (container && clipTextConfigurable && regionsList.length > 0 && isCheck) { + if (container.clientHeight + container.scrollTop + 1 >= container.scrollHeight) { + setLazyLoading(true); + loadMore(); + } + } + }; + + const loadMore = () => { + setTimeout(() => { + setVisibleCount((prev) => Math.min(prev + 5, regionsListFormat.length)); + setLazyLoading(false); + }, 300); + }; + return ( - <> - {config?.enablePlaceholderHotkey && ( -
-
- 占位符快捷输入 - -
䦆(Ctrl+1):
-
- 文字异常,但只根据这个字的形状就可以猜出是什么字 -
-
攫(Ctrl+2):
-
- 文字异常,且无法根据形状猜字,但能结合上下文语义判断出是什么字 +
+
+ {config?.enablePlaceholderHotkey && ( +
+
+ 占位符快捷输入 + +
䦆(Ctrl+1):
+
+ 文字异常,但只根据这个字的形状就可以猜出是什么字 +
+
攫(Ctrl+2):
+
+ 文字异常,且无法根据形状猜字,但能结合上下文语义判断出是什么字 +
+
玃(Ctrl+3):
+
完全无法判断是什么字
-
玃(Ctrl+3):
-
完全无法判断是什么字
+ } + placement='bottom' + > + + +
+ + addPlaceholder(e.target.value)}> +
+
䦆 (视觉)
+
Ctrl+1
- } - placement='bottom' - > - - +
+ addPlaceholder(e.target.value)}> +
+
攫 (语义)
+
Ctrl+2
+
+
+ addPlaceholder(e.target.value)}> +
+
玃 (无效)
+
Ctrl+3
+
+
+
- - addPlaceholder(e.target.value)}> -
-
䦆 (视觉)
-
Ctrl+1
-
-
- addPlaceholder(e.target.value)}> -
-
攫 (语义)
-
Ctrl+2
-
-
- addPlaceholder(e.target.value)}> -
-
玃 (无效)
-
Ctrl+3
-
-
-
-
- )} -
- - - {textConfigurable && - _configList.map((i, index) => ( - 1} - disabled={textInputDisabled} - textID={textID} - addPlaceholder={addPlaceholder} - onFocus={() => setFocusIndex(index)} - /> - ))} - {clipTextConfigurable && - regionsList.length > 0 && - regionsListFormat.map((item, index) => { - const { clipTextResult } = item; - const { id, start, end, attribute } = clipTextResult; - const { maxLength = 3000, label, key, required } = item; - const text = clipTextResult?.[key]; - const clipIdMapText = { [clipTextResult.id]: text }; - - // 兼容SingleTextInput的props - const config = { - label: `${label ?? t('textTool')}(${timeFormat(start, 'ss.SSS')} - ${timeFormat( - end, - 'ss.SSS', - )})`, - key: id, - maxLength, - }; - // 处理按tab无法正常切换问题 - const regionIndex = (textConfigurable ? _configList.length : 0) + index; - - const attributeColor = getAttributeColor(attribute, clipAttributeList); - - const textStyle = { - color: getAttributeFontColor(attribute, clipAttributeList), - backgroundColor: attributeColor, - }; - const errorTips = t('LeastCharacterError', { - num: 1, - }); - const errorText = required && text.length < 1 ? errorTips : undefined; - const attributeText = - getAttributeShowText(attribute, [ - { value: '', key: t('NoAttribute') }, - ...clipAttributeList, - ]) ?? ''; - return ( + )} +
+ + + {textConfigurable && + _configList.map((i, index) => ( 1} disabled={textInputDisabled} - result={clipIdMapText} - updateText={(text: string) => { - updateRegion?.({ - ...clipTextResult, - [key]: text, - }); - }} - switchToNextTextarea={() => { - switchToNextTextarea(regionIndex); + textID={textID} + addPlaceholder={addPlaceholder} + onFocus={() => setFocusIndex(index)} + /> + ))} + {clipTextConfigurable && regionsList.length > 0 && ( + <> + {regionsListFormat.slice(0, visibleCount).map((item, index) => { + const { clipTextResult } = item; + const { id, start, end, attribute } = clipTextResult; + const { maxLength = 3000, label, key, required } = item; + const text = clipTextResult?.[key]; + const clipIdMapText = { [clipTextResult.id]: text }; + + // 兼容SingleTextInput的props + const config = { + label: `${label ?? t('textTool')}(${timeFormat(start, 'ss.SSS')} - ${timeFormat( + end, + 'ss.SSS', + )})`, + key: id, + maxLength, + }; + // 处理按tab无法正常切换问题 + const regionIndex = (textConfigurable ? _configList.length : 0) + index; + + const attributeColor = getAttributeColor(attribute, clipAttributeList); + + const textStyle = { + color: getAttributeFontColor(attribute, clipAttributeList), + backgroundColor: attributeColor, + }; + const errorTips = t('LeastCharacterError', { + num: 1, + }); + const errorText = required && text.length < 1 ? errorTips : undefined; + const attributeText = + getAttributeShowText(attribute, [ + { value: '', key: t('NoAttribute') }, + ...clipAttributeList, + ]) ?? ''; + return ( + { + updateRegion?.({ + ...clipTextResult, + [key]: text, + }); + }} + switchToNextTextarea={() => { + switchToNextTextarea(regionIndex); + }} + hasMultiple={true} + onFocus={() => setFocusIndex(regionIndex)} + onFocusStyle={ + clipAttributeConfigurable + ? { + borderColor: attributeColor, + boxShadow: `0 0 0 2px ${updateColorOpacity(attributeColor, 0.4)}`, + } + : {} + } + extra={ + clipAttributeConfigurable ? ( +
+ +
+ ) : null + } + errorText={errorText} + /> + ); + })} + {lazyLoading && } + + )} + + {/* 文本显示按钮,不会存储在配置或结果中 */} + {toggleShowText && ( +
+ {t('toggleShowText')} + { + toggleShowText(v); }} - hasMultiple={true} - onFocus={() => setFocusIndex(regionIndex)} - onFocusStyle={ - clipAttributeConfigurable - ? { - borderColor: attributeColor, - boxShadow: `0 0 0 2px ${updateColorOpacity(attributeColor, 0.4)}`, - } - : {} - } - extra={ - clipAttributeConfigurable ? ( -
- -
- ) : null - } - errorText={errorText} /> - ); - })} - - {/* 文本显示按钮,不会存储在配置或结果中 */} - {toggleShowText && ( -
- {t('toggleShowText')} - { - toggleShowText(v); - }} - /> -
- )} +
+ )} +
- +
); }; diff --git a/packages/lb-components/src/components/audioPlayer/index.tsx b/packages/lb-components/src/components/audioPlayer/index.tsx index a20273117..0d7b02f1a 100644 --- a/packages/lb-components/src/components/audioPlayer/index.tsx +++ b/packages/lb-components/src/components/audioPlayer/index.tsx @@ -572,6 +572,7 @@ export const AudioPlayer = ({ wavesurfer.on('error', () => { setFileError(true); + setLoading(false) onLoaded?.({ hasError: true, }); From f8e6a04b680af57655091a930f81da9522f7f94c Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 29 Oct 2024 06:28:55 +0000 Subject: [PATCH 13/21] chore(release): 1.24.0-alpha.4 [skip ci] # @labelbee/lb-components [1.24.0-alpha.4](https://github.com/open-mmlab/labelbee/compare/@labelbee/lb-components@1.24.0-alpha.3...@labelbee/lb-components@1.24.0-alpha.4) (2024-10-29) ### Bug Fixes * Audio tool view mode optimization ([fe3ec3d](https://github.com/open-mmlab/labelbee/commit/fe3ec3d3dc0491a2c96102398117a645dc7226ab)) * LLMMulitWheel tool style adjustment ([eb763ac](https://github.com/open-mmlab/labelbee/commit/eb763acbf353cb4e1e2d893c9d0629dde4326132)) --- packages/lb-components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lb-components/package.json b/packages/lb-components/package.json index 2b38610f4..861181138 100644 --- a/packages/lb-components/package.json +++ b/packages/lb-components/package.json @@ -1,6 +1,6 @@ { "name": "@labelbee/lb-components", - "version": "1.24.0-alpha.3", + "version": "1.24.0-alpha.4", "description": "Provide a complete library of annotation components", "main": "./dist/index.js", "es": "./es/index.js", From 5d2349b58d1e78b4aca2dbc1a8ee15e64afb5ff6 Mon Sep 17 00:00:00 2001 From: lihqi <455711093@qq.com> Date: Wed, 30 Oct 2024 14:17:28 +0800 Subject: [PATCH 14/21] fix(lb-components): The tackID can be modified to 0 --- .../sidebar/PointCloudToolSidebar/index.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx b/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx index 092344d8b..2d57f737b 100644 --- a/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx +++ b/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx @@ -1,4 +1,4 @@ -import React, { useContext, useState, useEffect } from 'react'; +import React, { useContext, useState, useEffect, useMemo } from 'react'; import { EditFilled } from '@ant-design/icons'; import { ToolIcons } from '../ToolIcons'; import { EToolName } from '@/data/enums/ToolType'; @@ -42,6 +42,7 @@ import { SetTaskStepList } from '@/store/annotation/actionCreators'; import { usePointCloudViews } from '@/components/pointCloudView/hooks/usePointCloudViews'; import SubAttributeList from '@/components/subAttributeList'; import DynamicResizer from '@/components/DynamicResizer'; +import { isNumber } from 'lodash'; interface IProps { stepInfo: IStepInfo; toolInstance: ICustomToolInstance; // Created by useCustomToolInstance. @@ -61,6 +62,10 @@ const BoxTrackIDInput = () => { const selectedBoxTrackID = selectedBox?.info.trackID; + const hasSelectedBoxTrackID = useMemo(() => { + return isNumber(selectedBoxTrackID) && selectedBoxTrackID >= 0; + }, [selectedBoxTrackID]); + const hasDuplicateTrackID = (trackID: number) => { const duplicateBox = pointCloudBoxList.find( (v) => v.trackID === trackID && v.id !== selectedBox?.info.id, @@ -89,7 +94,7 @@ const BoxTrackIDInput = () => { return; } - if (!(newTrackID > 0)) { + if (newTrackID < 0) { message.error(t('PositiveIntegerCheck')); return; } @@ -120,7 +125,7 @@ const BoxTrackIDInput = () => { }} > {t('CurrentBoxTrackIDs')} - {selectedBoxTrackID && ( + {hasSelectedBoxTrackID && selectedBoxTrackID !== undefined && ( updateCurrentPolygonList(value)} @@ -135,13 +140,13 @@ const BoxTrackIDInput = () => { lineHeight: '12px', }} > - {isEdit && selectedBoxTrackID ? ( + {isEdit && hasSelectedBoxTrackID ? ( { setInputValue(e.target.value); }} - disabled={!selectedBoxTrackID} + disabled={!hasSelectedBoxTrackID} size='small' onBlur={() => { applyInputValue(); @@ -160,7 +165,7 @@ const BoxTrackIDInput = () => { cursor: typeof selectedBoxTrackID !== 'undefined' ? 'pointer' : 'not-allowed', }} onClick={() => { - if (selectedBoxTrackID) { + if (hasSelectedBoxTrackID) { setIsEdit(!isEdit); } }} From a8e85dc1c1457f02f40a3b8b7304f0fa2ca8e200 Mon Sep 17 00:00:00 2001 From: lihqi <455711093@qq.com> Date: Wed, 30 Oct 2024 15:01:21 +0800 Subject: [PATCH 15/21] fix(lb-components): Fix type issue --- .../views/MainView/sidebar/PointCloudToolSidebar/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx b/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx index 2d57f737b..6d325a127 100644 --- a/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx +++ b/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx @@ -125,9 +125,9 @@ const BoxTrackIDInput = () => { }} > {t('CurrentBoxTrackIDs')} - {hasSelectedBoxTrackID && selectedBoxTrackID !== undefined && ( + {hasSelectedBoxTrackID && ( updateCurrentPolygonList(value)} /> )} From f3b2f3ed5e0436eb1b977951f7ad6942d501a5cf Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 30 Oct 2024 07:06:55 +0000 Subject: [PATCH 16/21] chore(release): 1.24.0-alpha.5 [skip ci] # @labelbee/lb-components [1.24.0-alpha.5](https://github.com/open-mmlab/labelbee/compare/@labelbee/lb-components@1.24.0-alpha.4...@labelbee/lb-components@1.24.0-alpha.5) (2024-10-30) ### Bug Fixes * **lb-components:** Fix type issue ([a8e85dc](https://github.com/open-mmlab/labelbee/commit/a8e85dc1c1457f02f40a3b8b7304f0fa2ca8e200)) * **lb-components:** The tackID can be modified to 0 ([5d2349b](https://github.com/open-mmlab/labelbee/commit/5d2349b58d1e78b4aca2dbc1a8ee15e64afb5ff6)) --- packages/lb-components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lb-components/package.json b/packages/lb-components/package.json index 861181138..3973e7a77 100644 --- a/packages/lb-components/package.json +++ b/packages/lb-components/package.json @@ -1,6 +1,6 @@ { "name": "@labelbee/lb-components", - "version": "1.24.0-alpha.4", + "version": "1.24.0-alpha.5", "description": "Provide a complete library of annotation components", "main": "./dist/index.js", "es": "./es/index.js", From 66ae6956adaeb49f111befd4584b54bdf68d7b6a Mon Sep 17 00:00:00 2001 From: "lixinghua.vendor" Date: Wed, 30 Oct 2024 16:02:18 +0800 Subject: [PATCH 17/21] fix: LLMMultiWheel tool page turning data is disordered --- .../components/LLMMultiWheelView/sidebar/index.tsx | 12 +++++++----- .../src/views/MainView/LLMMultiWheelLayout/index.tsx | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/lb-components/src/components/LLMMultiWheelView/sidebar/index.tsx b/packages/lb-components/src/components/LLMMultiWheelView/sidebar/index.tsx index 55f5f04d2..a60acf327 100644 --- a/packages/lb-components/src/components/LLMMultiWheelView/sidebar/index.tsx +++ b/packages/lb-components/src/components/LLMMultiWheelView/sidebar/index.tsx @@ -168,10 +168,12 @@ const LLMMultiWheelToolSidebar = (props: IProps) => { const data = getRenderDataByResult(LLMConfig, { ...item, answerList: item?.answerList?.map((answer: any, index: number) => { - setNewAnswerListMap({ - ...newAnswerListMap, - [`${item.id}-${answer.id}`]: answer.answer, - }); + if (LLMConfig?.isTextEdit) { + setNewAnswerListMap({ + ...newAnswerListMap, + [`${item.id}-${answer.id}`]: answer.answer, + }); + } return { ...answer, order: index + 1, @@ -249,7 +251,7 @@ const LLMMultiWheelToolSidebar = (props: IProps) => { const newList = answerList?.map((i: IAnswerList) => { if (i?.order === order) { // text edit - if (key === 'textEdit' && isString(value)) { + if (key === 'textEdit' && isString(value) && isTextEdit) { setNewAnswerListMap({ ...newAnswerListMap, [`${selectedID}-${i?.id ?? ''}`]: value, diff --git a/packages/lb-components/src/views/MainView/LLMMultiWheelLayout/index.tsx b/packages/lb-components/src/views/MainView/LLMMultiWheelLayout/index.tsx index e35558d59..a7bb97044 100644 --- a/packages/lb-components/src/views/MainView/LLMMultiWheelLayout/index.tsx +++ b/packages/lb-components/src/views/MainView/LLMMultiWheelLayout/index.tsx @@ -41,6 +41,7 @@ const LLMMultiWheelLayout: React.FC = (props) => { defaultSize={{ width: 600, }} + maxWidth='95%' enable={{ left: true }} > Date: Wed, 30 Oct 2024 16:30:39 +0800 Subject: [PATCH 18/21] fix(lb-components): Display on top view when trackID is 0 --- .../src/core/toolOperation/pointCloud2dOperation.ts | 6 +++--- .../views/MainView/sidebar/PointCloudToolSidebar/index.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/lb-annotation/src/core/toolOperation/pointCloud2dOperation.ts b/packages/lb-annotation/src/core/toolOperation/pointCloud2dOperation.ts index ec371d9f0..850c34723 100644 --- a/packages/lb-annotation/src/core/toolOperation/pointCloud2dOperation.ts +++ b/packages/lb-annotation/src/core/toolOperation/pointCloud2dOperation.ts @@ -5,7 +5,7 @@ * @createdate 2022-07-11 * @author Ron */ -import _ from 'lodash'; +import _, { isNumber } from 'lodash'; import { IPointCloudConfig, toolStyleConverter, UpdatePolygonByDragList, INVALID_COLOR } from '@labelbee/lb-utils'; import { EDragTarget, ESortDirection, DEFAULT_TEXT_OFFSET } from '@/constant/annotation'; import { EPolygonPattern } from '@/constant/tool'; @@ -237,7 +237,7 @@ class PointCloud2dOperation extends PolygonOperation { isClose: true, lineType: this.config?.lineType, }); - if (polygon?.trackID) { + if (isNumber(polygon?.trackID) && polygon?.trackID >= 0) { this.renderdrawTrackID(polygon); } // Only the rectangle shows the direction. @@ -276,7 +276,7 @@ class PointCloud2dOperation extends PolygonOperation { // Only the rectangle shows the direction. if (selectedPolygon.isRect === true && this.showDirectionLine === true) { this.renderRectPolygonDirection(polygon); - if (selectedPolygon?.trackID) { + if (isNumber(selectedPolygon?.trackID) && selectedPolygon?.trackID >= 0) { this.renderdrawTrackID(selectedPolygon); } } diff --git a/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx b/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx index 6d325a127..8e3c35174 100644 --- a/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx +++ b/packages/lb-components/src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx @@ -94,7 +94,7 @@ const BoxTrackIDInput = () => { return; } - if (newTrackID < 0) { + if (!(newTrackID > 0)) { message.error(t('PositiveIntegerCheck')); return; } From b3917ed47497990e30ffdff5f9b8db0d0503783b Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 30 Oct 2024 08:45:02 +0000 Subject: [PATCH 19/21] chore(release): 1.24.0-alpha.6 [skip ci] # @labelbee/lb-components [1.24.0-alpha.6](https://github.com/open-mmlab/labelbee/compare/@labelbee/lb-components@1.24.0-alpha.5...@labelbee/lb-components@1.24.0-alpha.6) (2024-10-30) ### Bug Fixes * LLMMultiWheel tool page turning data is disordered ([66ae695](https://github.com/open-mmlab/labelbee/commit/66ae6956adaeb49f111befd4584b54bdf68d7b6a)) --- packages/lb-components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lb-components/package.json b/packages/lb-components/package.json index 3973e7a77..ffff98286 100644 --- a/packages/lb-components/package.json +++ b/packages/lb-components/package.json @@ -1,6 +1,6 @@ { "name": "@labelbee/lb-components", - "version": "1.24.0-alpha.5", + "version": "1.24.0-alpha.6", "description": "Provide a complete library of annotation components", "main": "./dist/index.js", "es": "./es/index.js", From 14273aa83a306f93875d85bcf2a05edd85600d13 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 30 Oct 2024 08:50:47 +0000 Subject: [PATCH 20/21] chore(release): 1.28.0-alpha.3 [skip ci] # @labelbee/lb-annotation [1.28.0-alpha.3](https://github.com/open-mmlab/labelbee/compare/@labelbee/lb-annotation@1.28.0-alpha.2...@labelbee/lb-annotation@1.28.0-alpha.3) (2024-10-30) ### Bug Fixes * **lb-components:** Display on top view when trackID is 0 ([6395015](https://github.com/open-mmlab/labelbee/commit/63950154b66191be2d3b31d4359fd3a990c72439)) --- packages/lb-annotation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lb-annotation/package.json b/packages/lb-annotation/package.json index d74b2053a..6644fcbf8 100644 --- a/packages/lb-annotation/package.json +++ b/packages/lb-annotation/package.json @@ -1,6 +1,6 @@ { "name": "@labelbee/lb-annotation", - "version": "1.28.0-alpha.2", + "version": "1.28.0-alpha.3", "description": "Annotation tool collection", "keywords": [ "annotation", From 281f81387456684139535168f780558e35ad0baa Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 30 Oct 2024 08:50:49 +0000 Subject: [PATCH 21/21] chore(release): 1.24.0-alpha.7 [skip ci] # [1.24.0-alpha.7](https://github.com/open-mmlab/labelbee/compare/@labelbee/lb-components@1.24.0-alpha.6...@labelbee/lb-components@1.24.0-alpha.7) (2024-10-30) ### Bug Fixes * **lb-components:** Display on top view when trackID is 0 ([6395015](https://github.com/open-mmlab/labelbee/commit/63950154b66191be2d3b31d4359fd3a990c72439)) --- packages/lb-components/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lb-components/package.json b/packages/lb-components/package.json index ffff98286..8b7626fe6 100644 --- a/packages/lb-components/package.json +++ b/packages/lb-components/package.json @@ -1,6 +1,6 @@ { "name": "@labelbee/lb-components", - "version": "1.24.0-alpha.6", + "version": "1.24.0-alpha.7", "description": "Provide a complete library of annotation components", "main": "./dist/index.js", "es": "./es/index.js", @@ -43,7 +43,7 @@ }, "dependencies": { "@ant-design/icons": "^4.6.2", - "@labelbee/lb-annotation": "1.28.0-alpha.2", + "@labelbee/lb-annotation": "1.28.0-alpha.3", "@labelbee/lb-utils": "1.19.0", "@labelbee/wavesurfer": "1.1.0", "@types/react-dom": "^18.2.7",