Skip to content

Commit

Permalink
Merge pull request #125 from xtreme1-io/dev
Browse files Browse the repository at this point in the history
v0.7.1
  • Loading branch information
JzDmUrMWzezh authored May 16, 2023
2 parents 96f15d9 + 6ce6749 commit bb1e0f5
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .ops/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ stages:

variables:
APP_NAME: "xtreme1"
APP_VERSION: "0.7.0"
APP_VERSION: "0.7.1"

FRONTEND_PACKAGE_DIR: "dist"
BACKEND_PACKAGE_NAME: "${APP_NAME}-backend-${APP_VERSION}-SNAPSHOT.jar"
Expand Down
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.7.0-green)
![](https://img.shields.io/badge/Release-v0.7.1-green)
![](https://img.shields.io/badge/License-Apache%202.0-blueviolet)
[![Slack](https://img.shields.io/badge/Join-Slack-orange.svg?logo=slack)](https://join.slack.com/t/xtreme1group/shared_invite/zt-1jhk36uzr-NpdpYXeQAEHN6rYJy5_6pg)
[![Twitter](https://img.shields.io/badge/Follow-Twitter-blue)](https://twitter.com/Xtreme1io)
Expand Down Expand Up @@ -59,8 +59,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.7.0/xtreme1-v0.7.0.zip
unzip -d xtreme1-v0.7.0 xtreme1-v0.7.0.zip
wget https://github.com/xtreme1-io/xtreme1/releases/download/v0.7.1/xtreme1-v0.7.1.zip
unzip -d xtreme1-v0.7.1 xtreme1-v0.7.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.7.0-SNAPSHOT.jar ./app.jar
COPY --from=build /build/target/xtreme1-backend-0.7.1-SNAPSHOT.jar ./app.jar
RUN mkdir -p config
RUN wget 'https://basicai-asset.s3.us-west-2.amazonaws.com/xtreme1/xtreme1-lidar-fusion-trial.zip' -O xtreme1-lidar-fusion-trial.zip
RUN wget 'https://basicai-asset.s3.us-west-2.amazonaws.com/xtreme1/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.7.0-SNAPSHOT.jar
java -Dspring.profiles.active=local -jar target/xtreme1-backend-0.7.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.7.0-SNAPSHOT</version>
<version>0.7.1-SNAPSHOT</version>
<name>Xtreme1 Backend</name>
<description></description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public class DataResultObjectExportBO {
*/
private String type;

/**
* Class id
*/
private Long classId;

/**
* Class name
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,7 @@ public void handleDataResult(File file, String dataName, DataAnnotationObjectBO
object.setVersion(0);
processClassAttributes(classMap, object);
Objects.requireNonNull(insertDataAnnotationObjectBO).setClassAttributes(JSONUtil.parseObj(object));
insertDataAnnotationObjectBO.setClassId(object.getClassId());
if (verifyDataResult(object, dataAnnotationObjectBO.getDataId(), dataName)) {
dataAnnotationObjectBOList.add(insertDataAnnotationObjectBO);
}
Expand Down Expand Up @@ -1712,6 +1713,7 @@ public List<DataExportBO> processData(List<DataInfoBO> dataList, DataInfoQueryBO
objectSourceList.forEach(o -> {
var dataResultObjectExportBO = DefaultConverter.convert(o.getClassAttributes(), DataResultObjectExportBO.class);
dataResultObjectExportBO.setClassName(classMap.get(o.getClassId()));
dataResultObjectExportBO.setClassId(o.getClassId());
objects.add(dataResultObjectExportBO);
});
dataResultExportBO.setObjects(objects);
Expand Down
11 changes: 11 additions & 0 deletions backend/src/main/java/ai/basic/x1/util/DecompressionFileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ai.basic.x1.usecase.exception.UsecaseException;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.URLUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
Expand All @@ -15,6 +16,8 @@
import java.net.HttpURLConnection;
import java.net.URL;

import static ai.basic.x1.entity.enums.UploadStatusEnum.FAILED;
import static ai.basic.x1.usecase.exception.UsecaseCode.DATASET_DATA_FILE_URL_ERROR;
import static ai.basic.x1.util.Constants.*;
import static cn.hutool.core.util.CharsetUtil.GBK;
import static cn.hutool.core.util.CharsetUtil.UTF_8;
Expand Down Expand Up @@ -124,6 +127,14 @@ public static void decompress(String filePath, String decompressPath) throws IOE
* @return boolean
*/
public static boolean validateUrl(String urlStr) {
var boo = validateUrlS(urlStr);
if (!boo) {
return validateUrlS(URLUtil.encode(urlStr));
}
return boo;
}

private static boolean validateUrlS(String urlStr) {
try {
var url = new URL(urlStr);
var oc = (HttpURLConnection) url.openConnection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@
</delete>

<delete id="deleteByDatasetId">
update dataset set del_unique_key = id, is_deleted = true where dataset_id = #{datasetId}
update data set del_unique_key = id, is_deleted = true where dataset_id = #{datasetId}
</delete>
</mapper>
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ services:
retries: 10
backend:
# By default, Compose will pull image from Docker Hub when no local image found.
image: basicai/xtreme1-backend:v0.7.0
image: basicai/xtreme1-backend:v0.7.1
# Uncomment this line and comment previous line to build image locally, not pull from Docker Hub.
# build: ./backend
ports:
Expand Down Expand Up @@ -95,7 +95,7 @@ services:
condition: service_healthy
frontend:
# By default, Compose will pull image from Docker Hub when no local image found.
image: basicai/xtreme1-frontend:v0.7.0
image: basicai/xtreme1-frontend:v0.7.1
# Uncomment this line and comment previous line to build image locally, not pull from Docker Hub.
# build: ./frontend
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,12 @@
isLoading.value = true;
setTimeout(() => {
isLoading.value = false;
emits('closeUpload', formState.url, UploadSourceEnum.URL);
emits('closeUpload', formState.url, {
source: UploadSourceEnum.URL,
resultType: resultType.value,
modelId: modelId.value,
dataFormat: dataFormat.value,
});
}, 1000);
} catch {}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,11 @@ export function useImgCard(props: {
const updatePcImageObject = () => {
const imgs: any[] = props.data.content
? props.data.content
.filter((record) => record?.directoryType?.includes('image'))
.slice(0, 3)
.map((img) => {
return Object.assign({}, img, { object: null });
})
.filter((record) => record?.directoryType?.includes('image'))
.slice(0, 3)
.map((img) => {
return Object.assign({}, img, { object: null });
})
: [];

if (
Expand Down Expand Up @@ -572,9 +572,11 @@ export function useImgCard(props: {
};

const getTextJson = async () => {
const jsonUrl = props.data.content[0]?.file?.url;
const data = (await fetch(jsonUrl as string)).json();
return data;
if (props.data.content[0].name.includes('json')) {
const jsonUrl = props.data.content[0]?.file?.url;
const data = (await fetch(jsonUrl as string)).json();
return data;
}
};

return {
Expand Down
26 changes: 18 additions & 8 deletions frontend/pc-tool/src/packages/pc-render/loader/PCDLoader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileLoader, Loader, LoaderUtils } from 'three';
import { FileLoader, Loader, LoaderUtils, MathUtils } from 'three';

type ICallBack = (args?: any) => void;
type PCDData = 'ascii' | 'binary_compressed' | 'binary';
Expand Down Expand Up @@ -182,8 +182,8 @@ class PCDLoader extends Loader {
const position = [];
// const normal = [];
const color = [];
const intensity = [];

let intensity = [];
let maxIntensity = -Infinity;
// ascii

let N = 1;
Expand Down Expand Up @@ -218,12 +218,16 @@ class PCDLoader extends Loader {
}
if (offset.i !== undefined) {
// [...Array(N)].forEach((e) => {
intensity.push(parseFloat(line[offset.i]));
const _i = parseFloat(line[offset.i]);
intensity.push(_i);
maxIntensity = Math.max(_i, maxIntensity);
// });
}
if (offset.intensity !== undefined) {
// [...Array(N)].forEach((e) => {
intensity.push(parseFloat(line[offset.intensity]));
const _i = parseFloat(line[offset.intensity]);
intensity.push(_i);
maxIntensity = Math.max(_i, maxIntensity);
// });
}
// if (offset.normal_x !== undefined) {
Expand Down Expand Up @@ -323,9 +327,13 @@ class PCDLoader extends Loader {
}

if (offset.i !== undefined) {
intensity.push(dataview.getFloat32(row + offset.i, this.littleEndian));
const _i = dataview.getFloat32(row + offset.i, this.littleEndian);
intensity.push(_i);
maxIntensity = Math.max(_i, maxIntensity);
} else if (offset.intensity !== undefined) {
intensity.push(dataview.getFloat32(row + offset.intensity, this.littleEndian));
const _i = dataview.getFloat32(row + offset.intensity, this.littleEndian);
intensity.push(_i);
maxIntensity = Math.max(_i, maxIntensity);
}

if (offset.rgb !== undefined) {
Expand All @@ -341,7 +349,9 @@ class PCDLoader extends Loader {
// }
}
}

if (maxIntensity > 255 || maxIntensity < 2) {
intensity = intensity.map((i) => MathUtils.mapLinear(i, 0, maxIntensity, 0, 255));
}
// build geometry
return {
position,
Expand Down

0 comments on commit bb1e0f5

Please sign in to comment.