Skip to content

Commit efce168

Browse files
committed
1、【核心升级】升级DJL版本到0.34.0
2、【平台支持】新增对 Linux ARM64 架构的全面支持 3、【通用视觉】集成零样本目标检测模型 4、【活体检测】优化视频检测流程,实现 Predictor 视频会话级复用 5、【人脸识别】SQLite人脸查询改进线程池 6、【人脸识别】修复 Milvus 向量库下 listFaces 接口的调用异常
1 parent 06cb54b commit efce168

File tree

49 files changed

+1517
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1517
-150
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,19 @@ SmartJavaAI是专为JAVA 开发者打造的一个功能丰富、开箱即用的
242242
</div>
243243
</td>
244244
</tr>
245+
<tr>
246+
<td>
247+
<div align="left">
248+
<p>零样本目标检测<br>(ZeroShot Object Detection)</p>
249+
- YOLO-World 模型 <br>
250+
</div>
251+
</td>
252+
<td>
253+
<div align="center">
254+
<img src="https://cdn.jsdelivr.net/gh/geekwenjie/SmartJavaAI-Site/images/vision/yolo-world.png" height = "200px"/>
255+
</div>
256+
</td>
257+
</tr>
245258
<tr>
246259
<td>
247260
<div align="left">
@@ -483,7 +496,7 @@ SmartJavaAI是专为JAVA 开发者打造的一个功能丰富、开箱即用的
483496
<dependency>
484497
<groupId>cn.smartjavaai</groupId>
485498
<artifactId>all</artifactId>
486-
<version>1.0.27</version>
499+
<version>1.1.0</version>
487500
</dependency>
488501
```
489502

all/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<parent>
77
<groupId>cn.smartjavaai</groupId>
88
<artifactId>smartjavaai-parent</artifactId>
9-
<version>1.0.27</version>
9+
<version>1.1.0</version>
1010
</parent>
1111

1212
<artifactId>all</artifactId>
13-
<version>1.0.27</version>
13+
<version>1.1.0</version>
1414
<name>${project.artifactId}</name>
1515
<description>SmartJavaAI</description>
1616
<url>https://github.com/geekwenjie/SmartJavaAI</url>

bom/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<parent>
77
<groupId>cn.smartjavaai</groupId>
88
<artifactId>smartjavaai-parent</artifactId>
9-
<version>1.0.27</version>
9+
<version>1.1.0</version>
1010
</parent>
1111

12-
<version>1.0.27</version>
12+
<version>1.1.0</version>
1313
<artifactId>bom</artifactId>
1414
<name>bom</name>
1515
<description>统一版本管理的 BOM 包,同时支持 import 和全量依赖</description>

common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>cn.smartjavaai</groupId>
88
<artifactId>smartjavaai-parent</artifactId>
9-
<version>1.0.27</version>
9+
<version>1.1.0</version>
1010
</parent>
1111

1212
<name>common</name>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package cn.smartjavaai.common.executor;
2+
3+
import java.util.concurrent.ExecutorService;
4+
import java.util.concurrent.SynchronousQueue;
5+
import java.util.concurrent.ThreadPoolExecutor;
6+
import java.util.concurrent.TimeUnit;
7+
8+
/**
9+
* @author dwj
10+
* @date 2025/11/26
11+
*/
12+
public class GlobalExecutor {
13+
14+
private static volatile ExecutorService executor;
15+
16+
public static ExecutorService getExecutor() {
17+
if (executor == null) {
18+
synchronized (GlobalExecutor.class) {
19+
if (executor == null) {
20+
int cores = Runtime.getRuntime().availableProcessors();
21+
executor = new ThreadPoolExecutor(
22+
cores,
23+
cores * 2,
24+
60L, TimeUnit.SECONDS,
25+
new SynchronousQueue<>(),
26+
runnable -> {
27+
Thread t = new Thread(runnable);
28+
t.setDaemon(true); // 守护线程
29+
return t;
30+
},
31+
new ThreadPoolExecutor.DiscardOldestPolicy()
32+
);
33+
}
34+
}
35+
}
36+
return executor;
37+
}
38+
39+
public static void shutdown() {
40+
if (executor != null) {
41+
executor.shutdown();
42+
try {
43+
if (!executor.awaitTermination(5, TimeUnit.SECONDS)) {
44+
executor.shutdownNow();
45+
}
46+
} catch (InterruptedException e) {
47+
executor.shutdownNow();
48+
Thread.currentThread().interrupt();
49+
}
50+
}
51+
}
52+
53+
}

examples/face-example/pom.xml

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<maven.compiler.source>11</maven.compiler.source>
1313
<maven.compiler.target>11</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<smartjavaai.version>1.0.27</smartjavaai.version>
15+
<smartjavaai.version>1.1.0</smartjavaai.version>
1616
<!--如果打包运行,需要替换成你的main-->
1717
<exec.mainClass>smartai.examples.face.facedet.FaceDetDemo</exec.mainClass>
1818

@@ -88,11 +88,10 @@
8888
<artifactId>face</artifactId>
8989
</dependency>
9090

91-
9291
<dependency>
9392
<groupId>ai.djl.pytorch</groupId>
9493
<artifactId>pytorch-jni</artifactId>
95-
<version>2.5.1-0.32.0</version>
94+
<version>2.7.1-0.34.0</version>
9695
<scope>runtime</scope>
9796
</dependency>
9897

@@ -129,7 +128,7 @@
129128
<groupId>ai.djl.pytorch</groupId>
130129
<artifactId>pytorch-native-cpu</artifactId>
131130
<classifier>${djl.platform.windows-x86_64}</classifier>
132-
<version>2.5.1</version>
131+
<version>2.7.1</version>
133132
<scope>runtime</scope>
134133
</dependency>
135134

@@ -167,19 +166,45 @@
167166
<groupId>ai.djl.pytorch</groupId>
168167
<artifactId>pytorch-native-cpu</artifactId>
169168
<classifier>${djl.platform.linux-x86_64}</classifier>
170-
<version>2.5.1</version>
169+
<version>2.7.1</version>
171170
<scope>runtime</scope>
172171
</dependency>
172+
173+
<!-- linux aarch64 平台 (保留对应平台的配置,可以减小包大小)-->
173174
<dependency>
174-
<groupId>ai.djl.pytorch</groupId>
175-
<artifactId>pytorch-native-cpu-precxx11</artifactId>
176-
<classifier>${djl.platform.linux-x86_64}</classifier>
177-
<version>2.5.1</version>
178-
<scope>runtime</scope>
175+
<groupId>org.bytedeco</groupId>
176+
<artifactId>javacpp</artifactId>
177+
<version>${javacv.version}</version>
178+
<classifier>${javacv.platform.linux-arm64}</classifier>
179+
</dependency>
180+
<dependency>
181+
<groupId>org.bytedeco</groupId>
182+
<artifactId>ffmpeg</artifactId>
183+
<version>6.1.1-1.5.10</version>
184+
<classifier>${javacv.platform.linux-arm64}</classifier>
179185
</dependency>
180186

187+
<dependency>
188+
<groupId>org.bytedeco</groupId>
189+
<artifactId>openblas</artifactId>
190+
<version>0.3.26-1.5.10</version>
191+
<classifier>${javacv.platform.linux-arm64}</classifier>
192+
</dependency>
181193

194+
<dependency>
195+
<groupId>org.bytedeco</groupId>
196+
<artifactId>opencv</artifactId>
197+
<version>4.9.0-1.5.10</version>
198+
<classifier>${javacv.platform.linux-arm64}</classifier>
199+
</dependency>
182200

201+
<dependency>
202+
<groupId>ai.djl.pytorch</groupId>
203+
<artifactId>pytorch-native-cpu</artifactId>
204+
<classifier>${djl.platform.linux-aarch64}</classifier>
205+
<version>2.7.1</version>
206+
<scope>runtime</scope>
207+
</dependency>
183208

184209
<!-- macOS M系列 平台 (保留对应平台的配置,可以减小包大小)-->
185210
<dependency>
@@ -213,7 +238,7 @@
213238
<groupId>ai.djl.pytorch</groupId>
214239
<artifactId>pytorch-native-cpu</artifactId>
215240
<classifier>${djl.platform.osx-aarch64}</classifier>
216-
<version>2.5.1</version>
241+
<version>2.7.1</version>
217242
<scope>runtime</scope>
218243
</dependency>
219244

examples/ocr-examples/pom.xml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<maven.compiler.source>11</maven.compiler.source>
1313
<maven.compiler.target>11</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<smartjavaai.version>1.0.27</smartjavaai.version>
15+
<smartjavaai.version>1.1.0</smartjavaai.version>
1616
<!--如果打包运行,需要替换成你的main-->
1717
<exec.mainClass>smartai.examples.ocr.common.OcrRecognizeDemo</exec.mainClass>
1818

@@ -95,7 +95,7 @@
9595
<dependency>
9696
<groupId>ai.djl.pytorch</groupId>
9797
<artifactId>pytorch-jni</artifactId>
98-
<version>2.5.1-0.32.0</version>
98+
<version>2.7.1-0.34.0</version>
9999
<scope>runtime</scope>
100100
</dependency>
101101

@@ -132,7 +132,7 @@
132132
<groupId>ai.djl.pytorch</groupId>
133133
<artifactId>pytorch-native-cpu</artifactId>
134134
<classifier>${djl.platform.windows-x86_64}</classifier>
135-
<version>2.5.1</version>
135+
<version>2.7.1</version>
136136
<scope>runtime</scope>
137137
</dependency>
138138

@@ -170,14 +170,43 @@
170170
<groupId>ai.djl.pytorch</groupId>
171171
<artifactId>pytorch-native-cpu</artifactId>
172172
<classifier>${djl.platform.linux-x86_64}</classifier>
173-
<version>2.5.1</version>
173+
<version>2.7.1</version>
174174
<scope>runtime</scope>
175175
</dependency>
176+
177+
<!-- linux aarch64 平台 (保留对应平台的配置,可以减小包大小)-->
178+
<dependency>
179+
<groupId>org.bytedeco</groupId>
180+
<artifactId>javacpp</artifactId>
181+
<version>${javacv.version}</version>
182+
<classifier>${javacv.platform.linux-arm64}</classifier>
183+
</dependency>
184+
<dependency>
185+
<groupId>org.bytedeco</groupId>
186+
<artifactId>ffmpeg</artifactId>
187+
<version>6.1.1-1.5.10</version>
188+
<classifier>${javacv.platform.linux-arm64}</classifier>
189+
</dependency>
190+
191+
<dependency>
192+
<groupId>org.bytedeco</groupId>
193+
<artifactId>openblas</artifactId>
194+
<version>0.3.26-1.5.10</version>
195+
<classifier>${javacv.platform.linux-arm64}</classifier>
196+
</dependency>
197+
198+
<dependency>
199+
<groupId>org.bytedeco</groupId>
200+
<artifactId>opencv</artifactId>
201+
<version>4.9.0-1.5.10</version>
202+
<classifier>${javacv.platform.linux-arm64}</classifier>
203+
</dependency>
204+
176205
<dependency>
177206
<groupId>ai.djl.pytorch</groupId>
178-
<artifactId>pytorch-native-cpu-precxx11</artifactId>
179-
<classifier>${djl.platform.linux-x86_64}</classifier>
180-
<version>2.5.1</version>
207+
<artifactId>pytorch-native-cpu</artifactId>
208+
<classifier>${djl.platform.linux-aarch64}</classifier>
209+
<version>2.7.1</version>
181210
<scope>runtime</scope>
182211
</dependency>
183212

@@ -214,7 +243,7 @@
214243
<groupId>ai.djl.pytorch</groupId>
215244
<artifactId>pytorch-native-cpu</artifactId>
216245
<classifier>${djl.platform.osx-aarch64}</classifier>
217-
<version>2.5.1</version>
246+
<version>2.7.1</version>
218247
<scope>runtime</scope>
219248
</dependency>
220249

examples/speech-examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<maven.compiler.source>11</maven.compiler.source>
1313
<maven.compiler.target>11</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<smartjavaai.version>1.0.27</smartjavaai.version>
15+
<smartjavaai.version>1.1.0</smartjavaai.version>
1616
<!--如果打包运行,需要替换成你的main-->
1717
<exec.mainClass>smartai.examples.speech.asr.common.OcrRecognizeDemo</exec.mainClass>
1818

examples/translation-example/pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<maven.compiler.source>11</maven.compiler.source>
1313
<maven.compiler.target>11</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<smartjavaai.version>1.0.27</smartjavaai.version>
15+
<smartjavaai.version>1.1.0</smartjavaai.version>
1616
<!--如果打包运行,需要替换成你的main-->
1717
<exec.mainClass>smartai.examples.nlp.translation.TranslationDemo</exec.mainClass>
1818

@@ -93,7 +93,7 @@
9393
<dependency>
9494
<groupId>ai.djl.pytorch</groupId>
9595
<artifactId>pytorch-jni</artifactId>
96-
<version>2.5.1-0.32.0</version>
96+
<version>2.7.1-0.34.0</version>
9797
<scope>runtime</scope>
9898
</dependency>
9999

@@ -104,7 +104,7 @@
104104
<groupId>ai.djl.pytorch</groupId>
105105
<artifactId>pytorch-native-cpu</artifactId>
106106
<classifier>${djl.platform.windows-x86_64}</classifier>
107-
<version>2.5.1</version>
107+
<version>2.7.1</version>
108108
<scope>runtime</scope>
109109
</dependency>
110110

@@ -116,25 +116,25 @@
116116
<groupId>ai.djl.pytorch</groupId>
117117
<artifactId>pytorch-native-cpu</artifactId>
118118
<classifier>${djl.platform.linux-x86_64}</classifier>
119-
<version>2.5.1</version>
119+
<version>2.7.1</version>
120120
<scope>runtime</scope>
121121
</dependency>
122122

123+
<!-- linux aarch64 平台 (保留对应平台的配置,可以减小包大小)-->
123124
<dependency>
124125
<groupId>ai.djl.pytorch</groupId>
125-
<artifactId>pytorch-native-cpu-precxx11</artifactId>
126-
<classifier>${djl.platform.linux-x86_64}</classifier>
127-
<version>2.5.1</version>
126+
<artifactId>pytorch-native-cpu</artifactId>
127+
<classifier>${djl.platform.linux-aarch64}</classifier>
128+
<version>2.7.1</version>
128129
<scope>runtime</scope>
129130
</dependency>
130131

131-
132132
<!-- macOS M系列 平台 (保留对应平台的配置,可以减小包大小)-->
133133
<dependency>
134134
<groupId>ai.djl.pytorch</groupId>
135135
<artifactId>pytorch-native-cpu</artifactId>
136136
<classifier>${djl.platform.osx-aarch64}</classifier>
137-
<version>2.5.1</version>
137+
<version>2.7.1</version>
138138
<scope>runtime</scope>
139139
</dependency>
140140

examples/translation-example/src/main/java/smartai/examples/nlp/translation/TranslationDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public TranslationModel getNllbModel() {
4444
//指定翻译模型:NLLB,切换模型需同时修改modelEnum及modelPath
4545
config.setModelEnum(TranslationModeEnum.NLLB_MODEL);
4646
//指定模型路径,需将模型路径修改为本地的模型路径
47-
config.setModelPath("/Users/xxx/Documents/develop/model/trans/traced_translation_cpu.pt");
47+
config.setModelPath("/Users/wenjie/Documents/develop/model/translate/nllb/traced_translation_cpu.pt");
4848
config.setDevice(DeviceEnum.CPU);
4949
return TranslationModelFactory.getInstance().getModel(config);
5050
}

0 commit comments

Comments
 (0)