|
@@ -248,13 +248,18 @@ public class DataServiceImpl extends BaseServiceImpl<DataMapper, Data> implement
|
|
|
countSize.getAndIncrement();
|
|
|
});
|
|
|
//是否选择已标注,如果已标注则需要检测所有图片是否标注
|
|
|
- if (!labeledList.isEmpty() && labeled) {
|
|
|
+ if (!labeledList.isEmpty()) {
|
|
|
// 已标注数量
|
|
|
long unmarkedCount = labeledList.stream().filter(Boolean.FALSE::equals).count();
|
|
|
// 未标注数量
|
|
|
long markedCount = labeledList.stream().filter(Boolean.TRUE::equals).count();
|
|
|
// 如果存在未标注的数据,则返回错误信息
|
|
|
- if (unmarkedCount > 0) {
|
|
|
+ if (unmarkedCount > 0 && labeled) {
|
|
|
+ String format = String.format("错误: 已标注文件 %d 个,未标注文件 %d 个", markedCount, unmarkedCount);
|
|
|
+ return CommonResult.fail(format);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (markedCount > 0 && !labeled) {
|
|
|
String format = String.format("错误: 已标注文件 %d 个,未标注文件 %d 个", markedCount, unmarkedCount);
|
|
|
return CommonResult.fail(format);
|
|
|
}
|