Skip to content

Commit bb1e0f5

Browse files
authored
Merge pull request #125 from xtreme1-io/dev
v0.7.1
2 parents 96f15d9 + 6ce6749 commit bb1e0f5

File tree

13 files changed

+62
-27
lines changed

13 files changed

+62
-27
lines changed

.ops/.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ stages:
55

66
variables:
77
APP_NAME: "xtreme1"
8-
APP_VERSION: "0.7.0"
8+
APP_VERSION: "0.7.1"
99

1010
FRONTEND_PACKAGE_DIR: "dist"
1111
BACKEND_PACKAGE_NAME: "${APP_NAME}-backend-${APP_VERSION}-SNAPSHOT.jar"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div align="center">
22
<img width="386" alt="Xtreme1 logo" src="https://user-images.githubusercontent.com/84139543/190300943-98da7d5c-bd67-4074-a94f-b7405d29fb90.png">
33

4-
![](https://img.shields.io/badge/Release-v0.7.0-green)
4+
![](https://img.shields.io/badge/Release-v0.7.1-green)
55
![](https://img.shields.io/badge/License-Apache%202.0-blueviolet)
66
[![Slack](https://img.shields.io/badge/Join-Slack-orange.svg?logo=slack)](https://join.slack.com/t/xtreme1group/shared_invite/zt-1jhk36uzr-NpdpYXeQAEHN6rYJy5_6pg)
77
[![Twitter](https://img.shields.io/badge/Follow-Twitter-blue)](https://twitter.com/Xtreme1io)
@@ -59,8 +59,8 @@ Image Data Curation (Visualizing & Debug) - [MobileNetV3](https://github.com/xi
5959
Download the latest release package and unzip it.
6060

6161
```bash
62-
wget https://github.com/xtreme1-io/xtreme1/releases/download/v0.7.0/xtreme1-v0.7.0.zip
63-
unzip -d xtreme1-v0.7.0 xtreme1-v0.7.0.zip
62+
wget https://github.com/xtreme1-io/xtreme1/releases/download/v0.7.1/xtreme1-v0.7.1.zip
63+
unzip -d xtreme1-v0.7.1 xtreme1-v0.7.1.zip
6464
```
6565

6666
## Start all services

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt update && \
99
apt install -y iputils-ping curl wget netcat python3 python3-pip git
1010
RUN pip3 install --upgrade --force-reinstall git+https://github.com/xtreme1-io/xtreme1-sdk.git@d0cf4cc
1111
WORKDIR /app
12-
COPY --from=build /build/target/xtreme1-backend-0.7.0-SNAPSHOT.jar ./app.jar
12+
COPY --from=build /build/target/xtreme1-backend-0.7.1-SNAPSHOT.jar ./app.jar
1313
RUN mkdir -p config
1414
RUN wget 'https://basicai-asset.s3.us-west-2.amazonaws.com/xtreme1/xtreme1-lidar-fusion-trial.zip' -O xtreme1-lidar-fusion-trial.zip
1515
RUN wget 'https://basicai-asset.s3.us-west-2.amazonaws.com/xtreme1/xtreme1-image-trial.zip' -O xtreme1-image-trial.zip

backend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ cd backend
9292
mvn package
9393

9494
# Using local configuration to start application.
95-
java -Dspring.profiles.active=local -jar target/xtreme1-backend-0.7.0-SNAPSHOT.jar
95+
java -Dspring.profiles.active=local -jar target/xtreme1-backend-0.7.1-SNAPSHOT.jar
9696
```
9797

9898
Now you can access the backend service at `http://localhost:8080/`.

backend/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<groupId>ai.basic</groupId>
1515
<artifactId>xtreme1-backend</artifactId>
16-
<version>0.7.0-SNAPSHOT</version>
16+
<version>0.7.1-SNAPSHOT</version>
1717
<name>Xtreme1 Backend</name>
1818
<description></description>
1919

backend/src/main/java/ai/basic/x1/entity/DataResultObjectExportBO.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ public class DataResultObjectExportBO {
1919
*/
2020
private String type;
2121

22+
/**
23+
* Class id
24+
*/
25+
private Long classId;
26+
2227
/**
2328
* Class name
2429
*/

backend/src/main/java/ai/basic/x1/usecase/DataInfoUseCase.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,7 @@ public void handleDataResult(File file, String dataName, DataAnnotationObjectBO
14601460
object.setVersion(0);
14611461
processClassAttributes(classMap, object);
14621462
Objects.requireNonNull(insertDataAnnotationObjectBO).setClassAttributes(JSONUtil.parseObj(object));
1463+
insertDataAnnotationObjectBO.setClassId(object.getClassId());
14631464
if (verifyDataResult(object, dataAnnotationObjectBO.getDataId(), dataName)) {
14641465
dataAnnotationObjectBOList.add(insertDataAnnotationObjectBO);
14651466
}
@@ -1712,6 +1713,7 @@ public List<DataExportBO> processData(List<DataInfoBO> dataList, DataInfoQueryBO
17121713
objectSourceList.forEach(o -> {
17131714
var dataResultObjectExportBO = DefaultConverter.convert(o.getClassAttributes(), DataResultObjectExportBO.class);
17141715
dataResultObjectExportBO.setClassName(classMap.get(o.getClassId()));
1716+
dataResultObjectExportBO.setClassId(o.getClassId());
17151717
objects.add(dataResultObjectExportBO);
17161718
});
17171719
dataResultExportBO.setObjects(objects);

backend/src/main/java/ai/basic/x1/util/DecompressionFileUtils.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import ai.basic.x1.usecase.exception.UsecaseException;
44
import cn.hutool.core.io.FileUtil;
5+
import cn.hutool.core.util.URLUtil;
56
import lombok.extern.slf4j.Slf4j;
67
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
78
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
@@ -15,6 +16,8 @@
1516
import java.net.HttpURLConnection;
1617
import java.net.URL;
1718

19+
import static ai.basic.x1.entity.enums.UploadStatusEnum.FAILED;
20+
import static ai.basic.x1.usecase.exception.UsecaseCode.DATASET_DATA_FILE_URL_ERROR;
1821
import static ai.basic.x1.util.Constants.*;
1922
import static cn.hutool.core.util.CharsetUtil.GBK;
2023
import static cn.hutool.core.util.CharsetUtil.UTF_8;
@@ -124,6 +127,14 @@ public static void decompress(String filePath, String decompressPath) throws IOE
124127
* @return boolean
125128
*/
126129
public static boolean validateUrl(String urlStr) {
130+
var boo = validateUrlS(urlStr);
131+
if (!boo) {
132+
return validateUrlS(URLUtil.encode(urlStr));
133+
}
134+
return boo;
135+
}
136+
137+
private static boolean validateUrlS(String urlStr) {
127138
try {
128139
var url = new URL(urlStr);
129140
var oc = (HttpURLConnection) url.openConnection();

backend/src/main/resources/mybatis/mapper/DataInfoMapper.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,6 @@
130130
</delete>
131131

132132
<delete id="deleteByDatasetId">
133-
update dataset set del_unique_key = id, is_deleted = true where dataset_id = #{datasetId}
133+
update data set del_unique_key = id, is_deleted = true where dataset_id = #{datasetId}
134134
</delete>
135135
</mapper>

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ services:
6565
retries: 10
6666
backend:
6767
# By default, Compose will pull image from Docker Hub when no local image found.
68-
image: basicai/xtreme1-backend:v0.7.0
68+
image: basicai/xtreme1-backend:v0.7.1
6969
# Uncomment this line and comment previous line to build image locally, not pull from Docker Hub.
7070
# build: ./backend
7171
ports:
@@ -95,7 +95,7 @@ services:
9595
condition: service_healthy
9696
frontend:
9797
# By default, Compose will pull image from Docker Hub when no local image found.
98-
image: basicai/xtreme1-frontend:v0.7.0
98+
image: basicai/xtreme1-frontend:v0.7.1
9999
# Uncomment this line and comment previous line to build image locally, not pull from Docker Hub.
100100
# build: ./frontend
101101
ports:

frontend/main/src/views/datasets/datasetContent/components/upload/UploadContent.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,12 @@
235235
isLoading.value = true;
236236
setTimeout(() => {
237237
isLoading.value = false;
238-
emits('closeUpload', formState.url, UploadSourceEnum.URL);
238+
emits('closeUpload', formState.url, {
239+
source: UploadSourceEnum.URL,
240+
resultType: resultType.value,
241+
modelId: modelId.value,
242+
dataFormat: dataFormat.value,
243+
});
239244
}, 1000);
240245
} catch {}
241246
};

frontend/main/src/views/datasets/datasetContent/components/useCardObject.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -510,11 +510,11 @@ export function useImgCard(props: {
510510
const updatePcImageObject = () => {
511511
const imgs: any[] = props.data.content
512512
? props.data.content
513-
.filter((record) => record?.directoryType?.includes('image'))
514-
.slice(0, 3)
515-
.map((img) => {
516-
return Object.assign({}, img, { object: null });
517-
})
513+
.filter((record) => record?.directoryType?.includes('image'))
514+
.slice(0, 3)
515+
.map((img) => {
516+
return Object.assign({}, img, { object: null });
517+
})
518518
: [];
519519

520520
if (
@@ -572,9 +572,11 @@ export function useImgCard(props: {
572572
};
573573

574574
const getTextJson = async () => {
575-
const jsonUrl = props.data.content[0]?.file?.url;
576-
const data = (await fetch(jsonUrl as string)).json();
577-
return data;
575+
if (props.data.content[0].name.includes('json')) {
576+
const jsonUrl = props.data.content[0]?.file?.url;
577+
const data = (await fetch(jsonUrl as string)).json();
578+
return data;
579+
}
578580
};
579581

580582
return {

frontend/pc-tool/src/packages/pc-render/loader/PCDLoader.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FileLoader, Loader, LoaderUtils } from 'three';
1+
import { FileLoader, Loader, LoaderUtils, MathUtils } from 'three';
22

33
type ICallBack = (args?: any) => void;
44
type PCDData = 'ascii' | 'binary_compressed' | 'binary';
@@ -182,8 +182,8 @@ class PCDLoader extends Loader {
182182
const position = [];
183183
// const normal = [];
184184
const color = [];
185-
const intensity = [];
186-
185+
let intensity = [];
186+
let maxIntensity = -Infinity;
187187
// ascii
188188

189189
let N = 1;
@@ -218,12 +218,16 @@ class PCDLoader extends Loader {
218218
}
219219
if (offset.i !== undefined) {
220220
// [...Array(N)].forEach((e) => {
221-
intensity.push(parseFloat(line[offset.i]));
221+
const _i = parseFloat(line[offset.i]);
222+
intensity.push(_i);
223+
maxIntensity = Math.max(_i, maxIntensity);
222224
// });
223225
}
224226
if (offset.intensity !== undefined) {
225227
// [...Array(N)].forEach((e) => {
226-
intensity.push(parseFloat(line[offset.intensity]));
228+
const _i = parseFloat(line[offset.intensity]);
229+
intensity.push(_i);
230+
maxIntensity = Math.max(_i, maxIntensity);
227231
// });
228232
}
229233
// if (offset.normal_x !== undefined) {
@@ -323,9 +327,13 @@ class PCDLoader extends Loader {
323327
}
324328

325329
if (offset.i !== undefined) {
326-
intensity.push(dataview.getFloat32(row + offset.i, this.littleEndian));
330+
const _i = dataview.getFloat32(row + offset.i, this.littleEndian);
331+
intensity.push(_i);
332+
maxIntensity = Math.max(_i, maxIntensity);
327333
} else if (offset.intensity !== undefined) {
328-
intensity.push(dataview.getFloat32(row + offset.intensity, this.littleEndian));
334+
const _i = dataview.getFloat32(row + offset.intensity, this.littleEndian);
335+
intensity.push(_i);
336+
maxIntensity = Math.max(_i, maxIntensity);
329337
}
330338

331339
if (offset.rgb !== undefined) {
@@ -341,7 +349,9 @@ class PCDLoader extends Loader {
341349
// }
342350
}
343351
}
344-
352+
if (maxIntensity > 255 || maxIntensity < 2) {
353+
intensity = intensity.map((i) => MathUtils.mapLinear(i, 0, maxIntensity, 0, 255));
354+
}
345355
// build geometry
346356
return {
347357
position,

0 commit comments

Comments
 (0)