Feat: 오토 레이블 성공 alert 추가

This commit is contained in:
jhynsoo 2024-09-26 17:11:58 +09:00
parent 28e5017c30
commit d6db0f0442
2 changed files with 8 additions and 11 deletions

View File

@ -68,12 +68,13 @@ export default function ImageCanvas() {
imageHeight: image!.height,
});
saveImageLabels(project.id, imageId, { data: json }).catch(() => {
alert('레이블 데이터 저장 실패');
});
// .then(() => {
// refetch();
// });
saveImageLabels(project.id, imageId, { data: json })
.catch(() => {
alert('레이블 데이터 저장 실패');
})
.then(() => {
alert('레이블링 성공!');
});
};
const startDrawRect = () => {
const { x, y } = stageRef.current!.getRelativePointerPosition()!;

View File

@ -1,10 +1,6 @@
import { LabelJson } from '@/types';
export default function createLabelJson(
type: 'classification' | 'detection' | 'segmentation'
// imageHeight: number,
// imageWidth: number
): LabelJson {
export default function createLabelJson(type: 'classification' | 'detection' | 'segmentation'): LabelJson {
return {
version: '0.1.0',
task_type: type === 'classification' ? 'cls' : type === 'detection' ? 'det' : 'seg',