Skip to content

Commit 19a13af

Browse files
authored
Merge pull request #299 from xtreme1-io/dev
Bug fixes.
2 parents eee3441 + d49e75a commit 19a13af

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

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/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()));

0 commit comments

Comments
 (0)