Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add annotate in image dataset scenes #192

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ops/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ include:

variables:
APP_NAME: "xtreme1"
APP_VERSION: "0.8"
APP_VERSION: "0.8.1"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<img width="386" alt="Xtreme1 logo" src="https://user-images.githubusercontent.com/84139543/190300943-98da7d5c-bd67-4074-a94f-b7405d29fb90.png">

![](https://img.shields.io/badge/Release-v0.8-green)
![](https://img.shields.io/badge/Release-v0.8.1-green)
![](https://img.shields.io/badge/License-Apache%202.0-blueviolet)
[![Twitter](https://img.shields.io/badge/Follow-Twitter-blue)](https://twitter.com/Xtreme1io)
[![Online](https://img.shields.io/badge/Xtreme1_Online-App-yellow)](https://app.basic.ai/#/login)
Expand Down Expand Up @@ -62,8 +62,8 @@ Image Data Curation (Visualizing & Debug) - [MobileNetV3](https://github.com/xi
Download the latest release package and unzip it.

```bash
wget https://github.com/xtreme1-io/xtreme1/releases/download/v0.8/xtreme1-v0.8.zip
unzip -d xtreme1-v0.8 xtreme1-v0.8.zip
wget https://github.com/xtreme1-io/xtreme1/releases/download/v0.8.1/xtreme1-v0.8.1.zip
unzip -d xtreme1-v0.8.1 xtreme1-v0.8.1.zip
```

## Start all services
Expand Down
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt update && \
apt install -y iputils-ping curl wget netcat python3 python3-pip git
RUN pip3 install --upgrade --force-reinstall git+https://github.com/xtreme1-io/xtreme1-sdk.git@d0cf4cc
WORKDIR /app
COPY --from=build /build/target/xtreme1-backend-0.8-SNAPSHOT.jar ./app.jar
COPY --from=build /build/target/xtreme1-backend-0.8.1-SNAPSHOT.jar ./app.jar
RUN mkdir -p config
RUN wget 'https://github.com/xtreme1-io/asset/raw/main/datasets/xtreme1-lidar-fusion-trial.zip' -O xtreme1-lidar-fusion-trial.zip
RUN wget 'https://github.com/xtreme1-io/asset/raw/main/datasets/xtreme1-image-trial.zip' -O xtreme1-image-trial.zip
Expand Down
2 changes: 1 addition & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ cd backend
mvn package

# Using local configuration to start application.
java -Dspring.profiles.active=local -jar target/xtreme1-backend-0.8-SNAPSHOT.jar
java -Dspring.profiles.active=local -jar target/xtreme1-backend-0.8.1-SNAPSHOT.jar
```

Now you can access the backend service at `http://localhost:8080/`.
Expand Down
2 changes: 1 addition & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>ai.basic</groupId>
<artifactId>xtreme1-backend</artifactId>
<version>0.8-SNAPSHOT</version>
<version>0.8.1-SNAPSHOT</version>
<name>Xtreme1 Backend</name>
<description></description>

Expand Down
24 changes: 17 additions & 7 deletions backend/src/main/java/ai/basic/x1/usecase/UploadDataUseCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ public void parseTextUploadFile(DataInfoUploadBO dataInfoUploadBO) {
var rootPath = String.format("%s/%s", userId, datasetId);
var errorBuilder = new StringBuilder();
var dataInfoBOBuilder = DataInfoBO.builder().datasetId(datasetId)
.parentId(Constants.DEFAULT_PARENT_ID)
.type(ItemTypeEnum.SINGLE_DATA)
.status(DataStatusEnum.VALID)
.annotationStatus(DataAnnotationStatusEnum.NOT_ANNOTATED)
Expand Down Expand Up @@ -349,7 +350,7 @@ public void parseTextUploadFile(DataInfoUploadBO dataInfoUploadBO) {
dataInfoBOList.add(dataInfoBO);
});
if (CollectionUtil.isNotEmpty(dataInfoBOList)) {
insertBatch(dataInfoBOList, datasetId, errorBuilder);
insertBatch(dataInfoBOList, datasetId, errorBuilder, Constants.DEFAULT_PARENT_ID);
}
} catch (Exception e) {
log.error("Handle data error", e);
Expand Down Expand Up @@ -463,7 +464,15 @@ public void commonParseUploadFile(DataInfoUploadBO dataInfoUploadBO, BiConsumer<
var dataAnnotationObjectBOBuilder = DataAnnotationObjectBO.builder()
.datasetId(datasetId).createdBy(userId).createdAt(OffsetDateTime.now()).sourceId(sourceId);
sceneFileList.forEach(sceneFile -> {
var sceneId = this.saveScene(sceneFile, dataInfoUploadBO);
Long sceneId;
try {
sceneId = this.saveScene(sceneFile, dataInfoUploadBO);
} catch (DuplicateKeyException e) {
log.error("The scene already exists,scene name is {}", sceneFile.getName());
errorBuilder.append("Duplicate scene names:").append(sceneFile.getName()).append(";");
return;
}

var dataNameList = getDataNamesFunction.apply(sceneFile);
if (CollectionUtil.isEmpty(dataNameList)) {
log.error("The file in {} folder is empty", sceneFile);
Expand Down Expand Up @@ -498,7 +507,7 @@ public void commonParseUploadFile(DataInfoUploadBO dataInfoUploadBO, BiConsumer<
}
});
if (CollectionUtil.isNotEmpty(dataInfoBOList)) {
var resDataInfoList = this.insertBatch(dataInfoBOList, datasetId, errorBuilder);
var resDataInfoList = this.insertBatch(dataInfoBOList, datasetId, errorBuilder, sceneId);
this.saveBatchDataResult(resDataInfoList, dataAnnotationObjectBOList);
}
} catch (Exception e) {
Expand Down Expand Up @@ -1045,9 +1054,9 @@ public String getFilename(File file) {
*
* @param dataInfoBOList Collection of data details
*/
public List<DataInfoBO> insertBatch(List<DataInfoBO> dataInfoBOList, Long datasetId, StringBuilder errorBuilder) {
public List<DataInfoBO> insertBatch(List<DataInfoBO> dataInfoBOList, Long datasetId, StringBuilder errorBuilder, Long parentId) {
var names = dataInfoBOList.stream().map(DataInfoBO::getName).collect(Collectors.toList());
var existDataInfoList = this.findByNames(datasetId, names);
var existDataInfoList = this.findByNames(datasetId, parentId, names);
if (CollUtil.isNotEmpty(existDataInfoList)) {
var existNames = existDataInfoList.stream().map(DataInfoBO::getName).collect(Collectors.toList());
dataInfoBOList = dataInfoBOList.stream().filter(dataInfoBO -> !existNames.contains(dataInfoBO.getName())).collect(Collectors.toList());
Expand All @@ -1071,10 +1080,11 @@ public List<DataInfoBO> insertBatch(List<DataInfoBO> dataInfoBOList, Long datase
}
}

private List<DataInfoBO> findByNames(Long datasetId, List<String> names) {
private List<DataInfoBO> findByNames(Long datasetId, Long parentId, List<String> names) {
var dataInfoLambdaQueryWrapper = Wrappers.lambdaQuery(DataInfo.class);
dataInfoLambdaQueryWrapper.eq(DataInfo::getDatasetId, datasetId);
dataInfoLambdaQueryWrapper.in(DataInfo::getName, names);
dataInfoLambdaQueryWrapper.eq(DataInfo::getParentId, parentId);
return DefaultConverter.convert(dataInfoDAO.list(dataInfoLambdaQueryWrapper), DataInfoBO.class);
}

Expand Down Expand Up @@ -1145,4 +1155,4 @@ private void getLeafNodeList(List<Tree<String>> treeNodes, List<Tree<String>> le
}
});
}
}
}
2 changes: 1 addition & 1 deletion frontend/image-tool/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="/iconfont/style.css" />
<link rel="stylesheet" href="/iconfont/iconfont.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Image Tool - Xtreme1</title>
</head>
Expand Down
8 changes: 5 additions & 3 deletions frontend/image-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
"@types/js-cookie": "^3.0.1",
"@types/qs": "^6.9.7",
"@types/three": "^0.136.1",
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@vueuse/components": "^8.6.0",
"@vueuse/core": "^8.6.0",
"ant-design-vue": "2.2.8",
"ant-design-vue": "3.2.19",
"axios": "^0.26.1",
"colord": "^2.9.2",
"cross-env": "^7.0.3",
Expand All @@ -34,7 +35,7 @@
"hotkeys-js": "^3.8.7",
"interactjs": "^1.10.11",
"js-cookie": "^3.0.1",
"konva": "^8.3.8",
"konva": "^9.2.3",
"less": "^4.1.2",
"less-loader": "^10.2.0",
"lodash": "^4.17.21",
Expand All @@ -50,7 +51,8 @@
"vue": "^3.2.25",
"vue-clipboard2": "^0.3.3",
"vue-i18n": "^9.1.9",
"vue-router": "^4.0.14"
"vue-router": "^4.0.14",
"vue3-colorpicker": "^2.2.3"
},
"devDependencies": {
"@commitlint/cli": "^16.2.3",
Expand Down
2 changes: 1 addition & 1 deletion frontend/image-tool/prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ module.exports = {
trailingComma: 'all',
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
tabWidth: 4,
tabWidth: 2,
endOfLine: 'auto',
};
7 changes: 0 additions & 7 deletions frontend/image-tool/public/iconfont/Read Me.txt

This file was deleted.

152 changes: 0 additions & 152 deletions frontend/image-tool/public/iconfont/demo-files/demo.css

This file was deleted.

30 changes: 0 additions & 30 deletions frontend/image-tool/public/iconfont/demo-files/demo.js

This file was deleted.

Loading
Loading