Skip to content

Commit 357e930

Browse files
committed
Merge branch 'main' into dev
2 parents ddaf7cb + 4543067 commit 357e930

File tree

11 files changed

+148
-46
lines changed

11 files changed

+148
-46
lines changed

.ops/.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include:
22
- project: 'basicai/xtreme1/common'
3-
file: '/ci/template/xtreme1-app.yml'
3+
file: '/ops/ci/template/xtreme1-app.yml'
44

55
variables:
66
APP_NAME: "xtreme1"

.ops/deploy/backend/base/backend.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,19 @@ spec:
3434
httpGet:
3535
path: /actuator/health/liveness
3636
port: 8080
37-
periodSeconds: 10
38-
failureThreshold: 6
37+
# 默认 periodSeconds 为 10s,failureThreshold 为 3 次,那么默认的等待时长为 10 * 3 = 30s,
38+
# 对于启动比较慢的 Java 应用不太够,需要上调 periodSeconds 或 failureThreshold
39+
failureThreshold: 10
3940
# 存活探针,会尝试多次,如果失败将重启服务
4041
livenessProbe:
4142
httpGet:
4243
path: /actuator/health/liveness
4344
port: 8080
44-
periodSeconds: 10
45-
failureThreshold: 3
4645
# 就绪探针,如果失败将拒绝服务
4746
readinessProbe:
4847
httpGet:
4948
path: /actuator/health/readiness
5049
port: 8080
51-
initialDelaySeconds: 10
52-
periodSeconds: 10
5350
volumeMounts:
5451
- name: config
5552
mountPath: /app/config

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ As you can see from [Xtreme1 GitHub](https://github.com/xtreme1-io/xtreme1), Xtr
2525

2626
| Component Name | Component Description | Related Language |
2727
|----------------|-----------------------|------------------|
28-
| [Frontend (FE)](https://github.com/xtreme1-io/xtreme1) | Xtreme1 web ui | Java |
29-
| [Backend (BE)](https://github.com/xtreme1-io/xtreme1) | Xtreme1 api service | JavaScript, TypeScript, HTML, CSS |
28+
| [Frontend (FE)](https://github.com/xtreme1-io/xtreme1) | Xtreme1 web ui | JavaScript, TypeScript, HTML, CSS |
29+
| [Backend (BE)](https://github.com/xtreme1-io/xtreme1) | Xtreme1 api service | Java |
3030
| [Docs](https://github.com/xtreme1-io/docs) | Xtreme1 documents | Markdown |
3131

3232
## Improving documentation

README.md

Lines changed: 127 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,24 @@
44
![](https://img.shields.io/badge/Release-v0.9.1-green)
55
![](https://img.shields.io/badge/License-Apache%202.0-blueviolet)
66
[![Twitter](https://img.shields.io/badge/Follow-Twitter-blue)](https://twitter.com/Xtreme1io)
7-
[![Online](https://img.shields.io/badge/Xtreme1_Online-App-yellow)](https://app.basic.ai/#/login)
87
[![Docs](https://img.shields.io/badge/Docs-Stable-success.svg?style=flat&longCache=true)](http://docs.xtreme1.io/)
98

10-
[![Use Cloud for Free](https://basicai-asset.s3.amazonaws.com/docs/Open-source/Operation/App_Button.png)](https://app.basic.ai/login)
9+
[![Use Cloud for Free](https://basicai-asset.s3.amazonaws.com/docs/Open-source/Operation/App_Button.png)](https://app.basic.ai)
1110
</div>
1211

13-
# Intro
14-
Xtreme1 is an all-in-one open-source platform for Multimodal training data.
12+
# Intro
1513

16-
Xtreme1 unlocks efficiency in data annotation, curation, and ontology management for tackling machine learning challenges in computer vision and LLM. The platform's AI-fueled tools elevate your annotation to the next efficiency level, powering your projects in 2D/3D Object Detection, 3D Instance Segmentation, and LiDAR-Camera Fusion like never before.
14+
Xtreme1 is an all-in-one open-source platform for multimodal training data.
1715

18-
A long-term free plan is offered in the Xtreme1 Cloud version. Click to [🎉 Use Cloud for Free](https://app.basic.ai/login).
16+
Xtreme1 unlocks efficiency in data annotation, curation, and ontology management for tackling machine learning challenges in computer vision and LLM. The platform's AI-fueled tools elevate your annotation to the next efficiency level, powering your projects in 2D/3D Object Detection, 2D/3D Semantic/Instance Segmentation, and LiDAR-Camera Fusion like never before.
1917

20-
# Documentation
18+
A long-term free plan is offered in the Xtreme1 Cloud version. Click to [🎉 Use Cloud for Free](https://app.basic.ai).
2119

22-
🎆 Welcome aboard! If you have any questions or doubts about features, installation, development, and deployment, you can always refer to our documentation.
20+
The README document only includes content related to installation, building, and running, if you have any questions or doubts about features, you can always refer to our [Docs Site](https://docs.xtreme1.io/xtreme1-docs/).
2321

24-
[📙 Find our docs here! ](https://docs.xtreme1.io/xtreme1-docs/)
22+
Find us on [Twitter](https://twitter.com/Xtreme1io) | [Medium](https://medium.com/multisensory-data-training) | [Issues](https://github.com/xtreme1-io/xtreme1/issues)
2523

26-
27-
# Find Us
28-
[Twitter](https://twitter.com/Xtreme1io) | [Medium](https://medium.com/multisensory-data-training) | [Issues](https://github.com/xtreme1-io/xtreme1/issues)
29-
30-
31-
# Key features
24+
# Key Features
3225

3326
Image Annotation (B-box, Segmentation) - [YOLOR](https://github.com/WongKinYiu/yolor) & [RITM](https://github.com/saic-vul/ritm_interactive_segmentation) | Lidar-camera Fusion Annotation - [OpenPCDet](https://github.com/open-mmlab/OpenPCDet) & [AB3DMOT](https://github.com/xinshuoweng/AB3DMOT)
3427
:-------------------------:|:-------------------------:
@@ -48,44 +41,95 @@ Image Annotation (B-box, Segmentation) - [YOLOR](https://github.com/WongKinYiu/y
4841

4942
:seven: RLHF for Large Language Models :new: (beta version)
5043

51-
Image Data Curation (Visualizing & Debug) - [MobileNetV3](https://github.com/xiaolai-sqlai/mobilenetv3) & [openTSNE](https://github.com/pavlin-policar/openTSNE) | RLHF Annotation tool for LLM (beta version)
44+
Image Data Curation (Visualizing & Debug) - [MobileNetV3](https://github.com/xiaolai-sqlai/mobilenetv3) & [openTSNE](https://github.com/pavlin-policar/openTSNE) | RLHF Annotation Tool for LLM (beta version)
5245
:-------------------------:|:-------------------------:
5346
![](/docs/images/2d_v.gif) | <img src="/docs/images/0.7rlhf.webp" width="640">
5447

55-
# Quick start
48+
# Install
49+
50+
## Prerequisites
51+
52+
*Operating System Requirements*
53+
54+
Any OS can install the Xtreme1 platform with Docker Compose (installing [Docker Desktop](https://docs.docker.com/desktop/) on Mac, Windows, and Linux devices). On the Linux server, you can install Docker Engine with [Docker Compose Plugin](https://docs.docker.com/compose/install/linux/).
55+
56+
*Hardware Requirements*
57+
58+
**CPU**: AMD64 or ARM64
59+
**RAM**: 2GB or higher
60+
**Hard Drive**: 10GB+ free disk space (depends on data size)
61+
62+
*Software Requirements*
63+
64+
For Mac, Windows, and Linux with desktop.
65+
66+
**Docker Desktop**: 4.1 or newer
67+
68+
For Linux server.
69+
70+
**Docker Engine**: 20.10 or newer
71+
**Docker Compose Plugin**: 2.0 or newer
5672

57-
* Get access to [Xtreme1 online version](https://app.basic.ai/#/login/) without any installation :rocket:
73+
*(Built-in) Models Deployment Requirements*
5874

59-
* [Install and Quick start](https://docs.xtreme1.io/xtreme1-docs/get-started/quick-start) :cd:
60-
* [Install with Docker](https://docs.xtreme1.io/xtreme1-docs/get-started/install-with-docker) 🐋
61-
* [Build Xtreme1 from source code](https://docs.xtreme1.io/xtreme1-docs/get-started/install-from-source) :wrench:
75+
The built-in model containers only can be running on Linux server with [NVIDIA CUDA Driver](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) and [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/index.html).
76+
77+
**GPU**: NVIDIA T4 or other similar GPU
78+
**RAM**: 4G or higher
79+
80+
## Install with Docker
81+
82+
### Download Package
6283

63-
## Download package
6484
Download the latest release package and unzip it.
6585

6686
```bash
6787
wget https://github.com/xtreme1-io/xtreme1/releases/download/v0.9.1/xtreme1-v0.9.1.zip
6888
unzip -d xtreme1-v0.9.1 xtreme1-v0.9.1.zip
6989
```
7090

71-
## Start all services
91+
### Start Services
92+
93+
Enter into the release package directory, and execute the following command to start all services. It needs a few minutes to initialize database and prepare a test dataset.
7294

7395
```bash
96+
cd xtreme1-v0.9.1
7497
docker compose up
7598
```
7699

77-
Visit [http://localhost:8190](http://localhost:8190) in the browser (Google Chrome is recommended) to try out Xtreme1!
100+
Visit [http://localhost:8190](http://localhost:8190) in the browser (Google Chrome is recommended) to try out Xtreme1! You can replace localhost with IP address if you want to access from another machine.
101+
102+
Docker compose will pull all service images from Docker Hub, including basic services `MySQL`, `Redis`, `MinIO`, and application services `backend`, `frontend`. You can find the username, password, hot binding port to access MySQL, Redis and MinIO in `docker-compose.yml`, for example you can access MinIO console at http://localhost:8194. We use Docker volume to save data, so you won't lose any data between container recreating.
103+
104+
Docker Compose advanced commands:
105+
106+
```bash
107+
# Start in the foreground.
108+
docker compose up
109+
110+
# Or add -d option to run in the background.
111+
docker compose up -d
112+
113+
# When finished, you can start or stop all or specific services.
114+
docker compose start
115+
docker compose stop
116+
117+
# Stop all services and delete all containers, but data volumes will be kept.
118+
docker compose down
119+
120+
# Danger! Delete all volumes. All data in MySQL, Redis and MinIO.
121+
docker compose down -v
122+
```
123+
124+
### Start Built-in Models
78125

79-
## ⚠️ Install built-in models
80126
You need to explicitly specify a model profile to enable model services.
81127

82128
```bash
83129
docker compose --profile model up
84130
```
85131

86-
## Enable model services
87-
88-
> Make sure you have installed [NVIDIA Driver](https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html) and [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker). But you do not need to install the CUDA Toolkit, as it already contained in the model image.
132+
Make sure you have installed [NVIDIA CUDA Driver](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) and [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/index.html) on host machine.
89133

90134
```bash
91135
# You need set "default-runtime" as "nvidia" in /etc/docker/daemon.json and restart docker to enable NVIDIA Container Toolkit
@@ -99,9 +143,63 @@ docker compose --profile model up
99143
"default-runtime": "nvidia"
100144
}
101145
```
146+
102147
If you use **Docker Desktop** + **WSL2.0**, please find this [issue #144](https://github.com/xtreme1-io/xtreme1/issues/144) for your reference.
103148

104-
![](/docs/images/3d_annotation2.png)
149+
### Run on ARM CPU
150+
151+
Please note that certain Docker images, including `MySQL`, may not be compatible with the ARM architecture. In case your computer is based on an ARM CPU (e.g. Apple M1), you can create a Docker Compose override file called docker-compose.override.yml and include the following content. While this method uses QEMU emulation to enforce the use of the ARM64 image on the ARM64 platform, it may impact performance.
152+
153+
```yaml
154+
services:
155+
mysql:
156+
platform: linux/amd64
157+
```
158+
159+
## Install from Source
160+
161+
If you want to build or extend the function, download the source code and run locally.
162+
163+
### Enable Docker BuildKit
164+
165+
We are using Docker BuildKit to accelerate the building speed, such as cache Maven and NPM packages between builds. By default BuildKit is not enabled in Docker Desktop, you can enable it as follows. For more details, you can check the official document [Build images with BuildKit](https://docs.docker.com/develop/develop-images/build_enhancements/).
166+
167+
```bash
168+
# Set the environment variable to enable BuildKit just for once.
169+
DOCKER_BUILDKIT=1 docker build .
170+
DOCKER_BUILDKIT=1 docker compose up
171+
172+
# Or edit Docker daemon.json to enable BuildKit by default, the content can be something like '{ "features": { "buildkit": true } }'.
173+
vi /etc/docker/daemon.json
174+
175+
# You can clear the builder cache if you encounter some package version related problem.
176+
docker builder prune
177+
```
178+
179+
### Clone Repository
180+
181+
```bash
182+
git clone https://github.com/basicai/xtreme1.git
183+
cd xtreme1
184+
```
185+
186+
### Build Images and Run Services
187+
188+
The `docker-compose.yml` default will pull application images from Docker Hub, if you want to build images from source code, you can comment on the service's image line and un-comment build line.
189+
190+
```yaml
191+
services:
192+
backend:
193+
# image: basicai/xtreme1-backend
194+
build: ./backend
195+
frontend:
196+
# image: basicai/xtreme1-frontend
197+
build: ./frontend
198+
```
199+
200+
Then when you run `docker compose up`, it will first build the `backend` and `frontend` image and start these services. Be sure to run `docker compose build` when code changes, as the up command will only build images when it does not exist.
201+
202+
> You should not commit your change to `docker-compose.yml`, to avoid this, you can copy docker-compose.yml to a new file `docker-compose.develop.yml`, and modify this file as your development needs, as this file is already added into `.gitignore`. And you need to specify this specific file when running Docker Compose commands, such as `docker compose -f docker-compose.develop.yml build`.
105203

106204
# License
107205
This software is licensed under the Apache 2.0 LICENSE. Xtreme1 is a trademark of LF AI & Data Foundation.

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN --mount=type=cache,target=/root/.m2 mvn package
77
FROM openjdk:11-jre
88
RUN apt update && \
99
apt install -y iputils-ping curl wget netcat python3 python3-pip git
10-
RUN pip3 install --upgrade --force-reinstall git+https://github.com/xtreme1-io/xtreme1-sdk.git@d0cf4cc
10+
RUN pip3 install --upgrade --force-reinstall git+https://github.com/xtreme1-io/xtreme1-sdk.git@6b53a73
1111
WORKDIR /app
1212
COPY --from=build /build/target/xtreme1-backend-0.9.1-SNAPSHOT.jar ./app.jar
1313
RUN mkdir -p config

backend/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</parent>
1313

1414
<groupId>ai.basic</groupId>
15-
<artifactId>xtreme1</artifactId>
15+
<artifactId>xtreme1-backend</artifactId>
1616
<version>0.9.1-SNAPSHOT</version>
1717

1818
<properties>

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,26 @@ private <Q extends BaseQueryBO> void getDataAndUpload(ExportRecord record, Strin
144144
var zipPath = srcPath + ".zip";
145145
File zipFile;
146146
var path = String.format("%s/%s", rootPath, FileUtil.getName(zipPath));
147+
147148
if (DataFormatEnum.COCO.equals(query.getDataFormat())) {
148149
var basePath = String.format("%s/%s", tempPath, IdUtil.fastSimpleUUID());
149150
var respPath = String.format("%s/resp.json", basePath);
150151
var baseOutPath = String.format("%s/%s", basePath, FileUtil.getPrefix(zipPath));
151152
var outPathNew = String.format("%s/result", baseOutPath);
152-
FileUtil.move(Path.of(String.format("%s/image", srcPath)), Path.of(String.format("%s/image", baseOutPath)), true);
153+
//FileUtil.move(Path.of(String.format("%s/image", srcPath)), Path.of(String.format("%s/image", baseOutPath)), true);
153154
ZipUtil.zip(srcPath, zipPath, true);
154155
FileUtil.mkdir(outPathNew);
155156
DataFormatUtil.convert(Constants.CONVERT_EXPORT, zipPath, outPathNew, respPath);
156157
if (FileUtil.exist(respPath) && UsecaseCode.OK.equals(DefaultConverter.convert(JSONUtil.readJSONObject(FileUtil.file(respPath), Charset.defaultCharset()), ApiResult.class).getCode())) {
157158
zipFile = ZipUtil.zip(baseOutPath, zipPath, true);
158159
} else {
159160
FileUtil.del(basePath);
160-
throw new UsecaseException("convert coco error");
161+
var exportRecordBO = exportRecordBOBuilder
162+
.status(ExportStatusEnum.FAILED)
163+
.updatedAt(OffsetDateTime.now())
164+
.build();
165+
exportRecordUsecase.saveOrUpdate(exportRecordBO);
166+
return;
161167
}
162168
FileUtil.del(basePath);
163169
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static void convert(String type, String srcPath, String outPath, String r
1515
FileUtil.mkParentDirs(respPath);
1616
ProcessBuilder builder = new ProcessBuilder();
1717
FileUtil.mkParentDirs(respPath);
18-
String command = String.format("xtreme1_ctl --mode '%s' -src '%s' -out '%s' --rps '%s' --format=coco", type, srcPath, outPath, respPath);
18+
String command = String.format("script_ctl --mode '%s' --src '%s' --dst '%s' --rps '%s' --fmt=coco", type, srcPath, outPath, respPath);
1919
builder.command("sh", "-c", command);
2020
Process process = builder.start();
2121
BufferedReader in = new BufferedReader(new InputStreamReader(process.getErrorStream()));

frontend/image-tool/src/package/image-editor/utils/data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export function copyData(
7070
updateTrans.transforms.push(copyedAttrs);
7171
} else {
7272
const newObject = annotate.cloneThisShape();
73+
newObject.userData.backId = undefined;
7374
newObject.userData.resultStatus = Const.Copied;
7475
addOption.objects.push(newObject);
7576
}

frontend/image-tool/src/package/image-ui/components/FrameLine/useBottom.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default function useBottom() {
141141
onMounted(() => {
142142
editor.on(EditorEvent.CURRENT_TRACK_CHANGE, onSelect);
143143
editor.on(EditorEvent.ANNOTATE_ADD, onUpdate);
144-
// editor.playManager.on(EditorEvent.PLAY_STOP, onFrameStop);
144+
PlayManager.instance.on(EditorEvent.PLAY_STOP, onFrameStop);
145145
// editor.cmdManager.addEventListener(EditorEvent.UNDO, onUpdate);
146146
// editor.cmdManager.addEventListener(EditorEvent.REDO, onUpdate);
147147
editor.hotkeyManager.bindSeriesFrameEvent();
@@ -154,7 +154,7 @@ export default function useBottom() {
154154
onBeforeUnmount(() => {
155155
editor.off(EditorEvent.CURRENT_TRACK_CHANGE, onSelect);
156156
editor.off(EditorEvent.ANNOTATE_ADD, onUpdate);
157-
// editor.playManager.off(EditorEvent.PLAY_STOP, onFrameStop);
157+
PlayManager.instance.off(EditorEvent.PLAY_STOP, onFrameStop);
158158
// editor.cmdManager.removeEventListener(EditorEvent.UNDO, onUpdate);
159159
// editor.cmdManager.removeEventListener(EditorEvent.REDO, onUpdate);
160160
});

0 commit comments

Comments
 (0)