@koala123/aoi-db 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ ## Description
2
+
3
+ AOIDB模块
4
+
5
+ > 此模块依赖anomaly.dll与og-common.dll库
6
+
7
+ ## Usage
8
+
9
+ ### Installation
10
+
11
+ ```bash
12
+ $ npm install @koala/aoi-db
13
+ ```
14
+
15
+ ```typescript
16
+ // app.module.ts
17
+ import { AOIDBModule } from '@koala/aoi-db';
18
+
19
+ @Module({
20
+ imports: [
21
+ AOIDBModule.forRoot({
22
+ /** dllPath;默认值:D:/kl-storage/dll/ */
23
+ dllPath: 'D:/kl-storage/dll/',
24
+ /** db路径;默认值:D:/kl-storage/gallery/db/ */
25
+ dbPath: 'D:/kl-storage/gallery/db/',
26
+ /** 引擎宽;默认值:5120 */
27
+ width: 5120,
28
+ /** 引擎高;默认值:5120 */
29
+ height: 5120,
30
+ /** 引擎通道;默认值:3 */
31
+ channel: 3,
32
+ /** 特征维度;默认值:384 */
33
+ featureDIM: 384,
34
+ /** 特征小图高;默认值:256 */
35
+ featureWidth: 256,
36
+ /** 特征小图宽;默认值:256 */
37
+ featureHeight: 256,
38
+ /** 外环切区域不能用于注册,注册无效区域(防呆区域);默认值64 */
39
+ deadproofArea: 64,
40
+ })
41
+ ],
42
+ controllers: [AppController],
43
+ providers: [AppService],
44
+ })
45
+
46
+ // app.service.ts
47
+ import { AOIDBService } from '@koala/aoi-db'
48
+ @Injectable()
49
+ export class AppService {
50
+ constructor(
51
+ public aoiDBService: AOIDBService,
52
+ ) {
53
+ // 加载test.db
54
+ console.log(this.aoiDBService.load('test.db'))
55
+ }
56
+ }
57
+ ```
58
+
59
+ ## AOIDBService API
60
+ - 初始化引擎
61
+ ```typescript
62
+ initEngine(): Promise<boolean>;
63
+ ```
64
+ - 销毁引擎
65
+ ```typescript
66
+ destroyEngine(): boolean;
67
+ ```
68
+ - 导出数据
69
+ ```typescript
70
+ interface Feature {
71
+ id: number;
72
+ type: number;
73
+ feature: string;
74
+ }
75
+ exportDB(db: string, exportFeature?: boolean): Promise<Feature[]>;
76
+ ```
77
+ - 查找所有db
78
+ ```typescript
79
+ findAll(): Promise<string[]>;
80
+ ```
81
+ - 加载DB到内存中,不存在则创建一个新的DB
82
+ ```typescript
83
+ /**
84
+ * 加载DB到内存中,不存在则创建一个新的DB
85
+ * @param db db路径;若父目录不存在,则创建失败;db目录是相对${dbPath}
86
+ * @param releaseFirst load之前先releaseDB
87
+ * @returns db的条目总数
88
+ */
89
+ load(db: string, releaseFirst?: boolean): Promise<number>
90
+ ```
91
+ - 释放DB
92
+ ```typescript
93
+ /**
94
+ * 释放DB
95
+ * @param db db路径
96
+ * @returns 此操作是否成功
97
+ */
98
+ release(db: string): Promise<boolean>;
99
+ ```
100
+ - 删除db文件
101
+ ```typescript
102
+ /**
103
+ * 删除db文件
104
+ * @param db db路径
105
+ * @returns 操作是否成功
106
+ */
107
+ delete(db: string): Promise<boolean>;
108
+ ```
109
+ 更多请查看`./dist/app.service.d.ts`
110
+ ## Router
111
+
112
+ 运行之后查看/aoiDB/
113
+
114
+
@@ -0,0 +1,22 @@
1
+ import { AppService } from './app.service';
2
+ import { FeatureDto, FeatureRes, InsertToDBDto, DeleteFromDBDto, EraseByTypeDto, UpdateDBDto, QueryDto, QueryRes, FeatureExtractDto, FeatureExtractRes, CoreLearnDto, CropSamplesDto, EraseSamplesDto, UpdateSamplesDto, InsertSamplesDto } from './app.dto';
3
+ export declare class AppController {
4
+ private readonly appService;
5
+ constructor(appService: AppService);
6
+ findAll(): Promise<string[]>;
7
+ exportDB(db: string): Promise<FeatureDto[]>;
8
+ load(db: string): Promise<number>;
9
+ release(db: string): Promise<boolean>;
10
+ delete(db: string): Promise<boolean>;
11
+ insert(body: InsertToDBDto): Promise<number>;
12
+ eraseByIds(body: DeleteFromDBDto): Promise<number>;
13
+ eraseByType(body: EraseByTypeDto): Promise<number>;
14
+ update(body: UpdateDBDto): Promise<number>;
15
+ query(body: QueryDto): Promise<QueryRes>;
16
+ featureExtract(body: FeatureExtractDto): Promise<FeatureExtractRes>;
17
+ coreLearn(body: CoreLearnDto): Promise<FeatureRes[]>;
18
+ cropSamplesBySrc(body: CropSamplesDto): Promise<boolean>;
19
+ eraseSamples(body: EraseSamplesDto): Promise<number>;
20
+ updateSamples(body: UpdateSamplesDto): Promise<number>;
21
+ insertSamples(body: InsertSamplesDto): Promise<number>;
22
+ }
@@ -0,0 +1,257 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.AppController = void 0;
16
+ const openapi = require("@nestjs/swagger");
17
+ const common_1 = require("@nestjs/common");
18
+ const swagger_1 = require("@nestjs/swagger");
19
+ const app_service_1 = require("./app.service");
20
+ const app_dto_1 = require("./app.dto");
21
+ let AppController = class AppController {
22
+ constructor(appService) {
23
+ this.appService = appService;
24
+ }
25
+ findAll() {
26
+ return this.appService.findAll();
27
+ }
28
+ exportDB(db) {
29
+ return this.appService.exportDB(db, false);
30
+ }
31
+ load(db) {
32
+ return this.appService.load(db);
33
+ }
34
+ release(db) {
35
+ return this.appService.release(db);
36
+ }
37
+ delete(db) {
38
+ return this.appService.delete(db);
39
+ }
40
+ insert(body) {
41
+ return this.appService.insert(body.db, body.data);
42
+ }
43
+ eraseByIds(body) {
44
+ return this.appService.eraseByIds(body.db, body.ids);
45
+ }
46
+ eraseByType(body) {
47
+ return this.appService.eraseByType(body.db, body.type);
48
+ }
49
+ update(body) {
50
+ return this.appService.update(body.db, body.data);
51
+ }
52
+ query(body) {
53
+ return this.appService.query(body.db, body.features);
54
+ }
55
+ async featureExtract(body) {
56
+ return await this.appService.featureExtract(body);
57
+ }
58
+ async coreLearn(body) {
59
+ return await this.appService.coreLearn(body);
60
+ }
61
+ async cropSamplesBySrc(body) {
62
+ return await this.appService.cropSamplesBySrc(body);
63
+ }
64
+ async eraseSamples(body) {
65
+ return await this.appService.eraseSamples(body.db, body.srcs);
66
+ }
67
+ async updateSamples(body) {
68
+ return await this.appService.updateSamples(body.db, body.data);
69
+ }
70
+ async insertSamples(body) {
71
+ return await this.appService.insertSamples(body.db, body.data);
72
+ }
73
+ };
74
+ exports.AppController = AppController;
75
+ __decorate([
76
+ (0, common_1.Post)('findAll'),
77
+ (0, swagger_1.ApiOperation)({ summary: '获取所有db' }),
78
+ (0, swagger_1.ApiResponse)({ type: [String], status: 201, description: '.db库列表' }),
79
+ openapi.ApiResponse({ status: 201, type: [String] }),
80
+ __metadata("design:type", Function),
81
+ __metadata("design:paramtypes", []),
82
+ __metadata("design:returntype", Promise)
83
+ ], AppController.prototype, "findAll", null);
84
+ __decorate([
85
+ (0, common_1.Post)('exportDB'),
86
+ (0, swagger_1.ApiOperation)({ summary: '导出DB' }),
87
+ (0, swagger_1.ApiBody)({ type: app_dto_1.DBDto }),
88
+ (0, swagger_1.ApiResponse)({ type: [app_dto_1.FeatureDto], status: 201, description: 'db数据列表' }),
89
+ openapi.ApiResponse({ status: 201, type: [require("./app.dto").FeatureDto] }),
90
+ __param(0, (0, common_1.Body)('db')),
91
+ __metadata("design:type", Function),
92
+ __metadata("design:paramtypes", [String]),
93
+ __metadata("design:returntype", Promise)
94
+ ], AppController.prototype, "exportDB", null);
95
+ __decorate([
96
+ (0, common_1.Post)('load'),
97
+ (0, swagger_1.ApiOperation)({ summary: '加载DB到内存中,不存在则创建' }),
98
+ (0, swagger_1.ApiBody)({ type: app_dto_1.DBDto }),
99
+ (0, swagger_1.ApiResponse)({ type: Number, status: 201, description: 'db的条目总数' }),
100
+ openapi.ApiResponse({ status: 201, type: Number }),
101
+ __param(0, (0, common_1.Body)('db')),
102
+ __metadata("design:type", Function),
103
+ __metadata("design:paramtypes", [String]),
104
+ __metadata("design:returntype", Promise)
105
+ ], AppController.prototype, "load", null);
106
+ __decorate([
107
+ (0, common_1.Post)('release'),
108
+ (0, swagger_1.ApiOperation)({ summary: '释放DB' }),
109
+ (0, swagger_1.ApiBody)({ type: app_dto_1.DBDto }),
110
+ (0, swagger_1.ApiResponse)({ type: Boolean, status: 201, description: '此操作是否成功' }),
111
+ openapi.ApiResponse({ status: 201, type: Boolean }),
112
+ __param(0, (0, common_1.Body)('db')),
113
+ __metadata("design:type", Function),
114
+ __metadata("design:paramtypes", [String]),
115
+ __metadata("design:returntype", Promise)
116
+ ], AppController.prototype, "release", null);
117
+ __decorate([
118
+ (0, common_1.Post)('delete'),
119
+ (0, swagger_1.ApiOperation)({ summary: '删除db文件,若此db文件已被加载到内存中,此接口会先释放再删除' }),
120
+ (0, swagger_1.ApiBody)({ type: app_dto_1.DBDto }),
121
+ (0, swagger_1.ApiResponse)({ type: Boolean, status: 201, description: '此操作是否成功' }),
122
+ openapi.ApiResponse({ status: 201, type: Boolean }),
123
+ __param(0, (0, common_1.Body)('db')),
124
+ __metadata("design:type", Function),
125
+ __metadata("design:paramtypes", [String]),
126
+ __metadata("design:returntype", Promise)
127
+ ], AppController.prototype, "delete", null);
128
+ __decorate([
129
+ (0, common_1.Post)('insert'),
130
+ (0, swagger_1.ApiOperation)({ summary: '插入数据' }),
131
+ (0, swagger_1.ApiBody)({ type: app_dto_1.InsertToDBDto }),
132
+ (0, swagger_1.ApiResponse)({ type: Number, status: 201, description: 'db的条目总数' }),
133
+ openapi.ApiResponse({ status: 201, type: Number }),
134
+ __param(0, (0, common_1.Body)()),
135
+ __metadata("design:type", Function),
136
+ __metadata("design:paramtypes", [app_dto_1.InsertToDBDto]),
137
+ __metadata("design:returntype", Promise)
138
+ ], AppController.prototype, "insert", null);
139
+ __decorate([
140
+ (0, common_1.Post)('eraseByIds'),
141
+ (0, swagger_1.ApiOperation)({ summary: '通过id列表删除数据' }),
142
+ (0, swagger_1.ApiBody)({ type: app_dto_1.DeleteFromDBDto }),
143
+ (0, swagger_1.ApiResponse)({ type: Number, status: 201, description: 'db的条目总数' }),
144
+ openapi.ApiResponse({ status: 201, type: Number }),
145
+ __param(0, (0, common_1.Body)()),
146
+ __metadata("design:type", Function),
147
+ __metadata("design:paramtypes", [app_dto_1.DeleteFromDBDto]),
148
+ __metadata("design:returntype", Promise)
149
+ ], AppController.prototype, "eraseByIds", null);
150
+ __decorate([
151
+ (0, common_1.Post)('eraseByType'),
152
+ (0, swagger_1.ApiOperation)({ summary: '通过类型type删除数据' }),
153
+ (0, swagger_1.ApiBody)({ type: app_dto_1.EraseByTypeDto }),
154
+ (0, swagger_1.ApiResponse)({ type: Number, status: 201, description: 'db的条目总数' }),
155
+ openapi.ApiResponse({ status: 201, type: Number }),
156
+ __param(0, (0, common_1.Body)()),
157
+ __metadata("design:type", Function),
158
+ __metadata("design:paramtypes", [app_dto_1.EraseByTypeDto]),
159
+ __metadata("design:returntype", Promise)
160
+ ], AppController.prototype, "eraseByType", null);
161
+ __decorate([
162
+ (0, common_1.Post)('update'),
163
+ (0, swagger_1.ApiOperation)({ summary: '更新db' }),
164
+ (0, swagger_1.ApiBody)({ type: app_dto_1.UpdateDBDto }),
165
+ (0, swagger_1.ApiResponse)({ type: Boolean, status: 201, description: '更新数目' }),
166
+ openapi.ApiResponse({ status: 201, type: Number }),
167
+ __param(0, (0, common_1.Body)()),
168
+ __metadata("design:type", Function),
169
+ __metadata("design:paramtypes", [app_dto_1.UpdateDBDto]),
170
+ __metadata("design:returntype", Promise)
171
+ ], AppController.prototype, "update", null);
172
+ __decorate([
173
+ (0, common_1.Post)('query'),
174
+ (0, swagger_1.ApiOperation)({ summary: '根据feature查询最近邻的type与score' }),
175
+ (0, swagger_1.ApiBody)({ type: app_dto_1.QueryDto }),
176
+ (0, swagger_1.ApiResponse)({ type: app_dto_1.QueryRes, status: 201 }),
177
+ openapi.ApiResponse({ status: 201, type: require("./app.dto").QueryRes }),
178
+ __param(0, (0, common_1.Body)()),
179
+ __metadata("design:type", Function),
180
+ __metadata("design:paramtypes", [app_dto_1.QueryDto]),
181
+ __metadata("design:returntype", void 0)
182
+ ], AppController.prototype, "query", null);
183
+ __decorate([
184
+ (0, common_1.Post)("featureExtract"),
185
+ (0, swagger_1.ApiOperation)({ summary: "提取小图的特征" }),
186
+ (0, swagger_1.ApiBody)({ type: app_dto_1.FeatureExtractDto }),
187
+ (0, swagger_1.ApiResponse)({ type: app_dto_1.FeatureExtractRes, status: 201, description: "提取特征结果" }),
188
+ openapi.ApiResponse({ status: 201, type: require("./app.dto").FeatureExtractRes }),
189
+ __param(0, (0, common_1.Body)()),
190
+ __metadata("design:type", Function),
191
+ __metadata("design:paramtypes", [app_dto_1.FeatureExtractDto]),
192
+ __metadata("design:returntype", Promise)
193
+ ], AppController.prototype, "featureExtract", null);
194
+ __decorate([
195
+ (0, common_1.Post)("coreLearn"),
196
+ (0, swagger_1.ApiOperation)({
197
+ summary: "采集正常图像上的特征向量",
198
+ description: "采集正常图像上的特征向量,此操作会向db写入特征数据与生成对应的sample小图",
199
+ }),
200
+ (0, swagger_1.ApiBody)({ type: app_dto_1.CoreLearnDto }),
201
+ (0, swagger_1.ApiResponse)({ type: [app_dto_1.FeatureRes], status: 201, description: "提取的特征数组" }),
202
+ openapi.ApiResponse({ status: 201, type: [require("./app.dto").FeatureRes] }),
203
+ __param(0, (0, common_1.Body)()),
204
+ __metadata("design:type", Function),
205
+ __metadata("design:paramtypes", [app_dto_1.CoreLearnDto]),
206
+ __metadata("design:returntype", Promise)
207
+ ], AppController.prototype, "coreLearn", null);
208
+ __decorate([
209
+ (0, common_1.Post)("cropSamplesBySrc"),
210
+ (0, swagger_1.ApiOperation)({ summary: "裁剪sample小图" }),
211
+ (0, swagger_1.ApiBody)({ type: app_dto_1.CropSamplesDto }),
212
+ (0, swagger_1.ApiResponse)({ type: Boolean, status: 201, description: '此操作是否成功' }),
213
+ openapi.ApiResponse({ status: 201, type: Boolean }),
214
+ __param(0, (0, common_1.Body)()),
215
+ __metadata("design:type", Function),
216
+ __metadata("design:paramtypes", [app_dto_1.CropSamplesDto]),
217
+ __metadata("design:returntype", Promise)
218
+ ], AppController.prototype, "cropSamplesBySrc", null);
219
+ __decorate([
220
+ (0, common_1.Post)("eraseSamples"),
221
+ (0, swagger_1.ApiOperation)({ summary: "删除sample小图" }),
222
+ (0, swagger_1.ApiBody)({ type: app_dto_1.EraseSamplesDto }),
223
+ (0, swagger_1.ApiResponse)({ type: Number, status: 201, description: 'db的条目总数' }),
224
+ openapi.ApiResponse({ status: 201, type: Number }),
225
+ __param(0, (0, common_1.Body)()),
226
+ __metadata("design:type", Function),
227
+ __metadata("design:paramtypes", [app_dto_1.EraseSamplesDto]),
228
+ __metadata("design:returntype", Promise)
229
+ ], AppController.prototype, "eraseSamples", null);
230
+ __decorate([
231
+ (0, common_1.Post)("updateSamples"),
232
+ (0, swagger_1.ApiOperation)({ summary: "移动sample小图" }),
233
+ (0, swagger_1.ApiBody)({ type: app_dto_1.UpdateSamplesDto }),
234
+ (0, swagger_1.ApiResponse)({ type: Number, status: 201, description: '更新数目' }),
235
+ openapi.ApiResponse({ status: 201, type: Number }),
236
+ __param(0, (0, common_1.Body)()),
237
+ __metadata("design:type", Function),
238
+ __metadata("design:paramtypes", [app_dto_1.UpdateSamplesDto]),
239
+ __metadata("design:returntype", Promise)
240
+ ], AppController.prototype, "updateSamples", null);
241
+ __decorate([
242
+ (0, common_1.Post)("insertSamples"),
243
+ (0, swagger_1.ApiOperation)({ summary: "insert小图" }),
244
+ (0, swagger_1.ApiBody)({ type: app_dto_1.InsertSamplesDto }),
245
+ (0, swagger_1.ApiResponse)({ type: Number, status: 201, description: 'db的条目总数' }),
246
+ openapi.ApiResponse({ status: 201, type: Number }),
247
+ __param(0, (0, common_1.Body)()),
248
+ __metadata("design:type", Function),
249
+ __metadata("design:paramtypes", [app_dto_1.InsertSamplesDto]),
250
+ __metadata("design:returntype", Promise)
251
+ ], AppController.prototype, "insertSamples", null);
252
+ exports.AppController = AppController = __decorate([
253
+ (0, common_1.Controller)("aoiDB"),
254
+ (0, swagger_1.ApiTags)("aoiDB"),
255
+ __metadata("design:paramtypes", [app_service_1.AppService])
256
+ ], AppController);
257
+ //# sourceMappingURL=app.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAA8E;AAC9E,+CAA2C;AAC3C,uCAiBmB;AAIZ,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAI,CAAC;IAKxD,OAAO;QACL,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;IAMD,QAAQ,CAAa,EAAU;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAMD,IAAI,CAAa,EAAU;QACzB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAMD,OAAO,CAAa,EAAU;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC;IAMD,MAAM,CAAa,EAAU;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CA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AC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;;IAC/C,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,yBAAe;;iDAE/C;AAMK;IAJL,IAAA,aAAI,EAAC,eAAe,CAAC;IACrB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IACvC,IAAA,iBAAO,EAAC,EAAE,IAAI,EAAE,0BAAgB,EAAE,CAAC;IACnC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;;IAC3C,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,0BAAgB;;kDAEjD;AAMK;IAJL,IAAA,aAAI,EAAC,eAAe,CAAC;IACrB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IACrC,IAAA,iBAAO,EAAC,EAAE,IAAI,EAAE,0BAAgB,EAAE,CAAC;IACnC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;;IAC9C,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,0BAAgB;;kDAEjD;wBAnIU,aAAa;IAFzB,IAAA,mBAAU,EAAC,OAAO,CAAC;IACnB,IAAA,iBAAO,EAAC,OAAO,CAAC;qCAE0B,wBAAU;GADxC,aAAa,CAqIzB"}
@@ -0,0 +1,83 @@
1
+ export declare class DBDto {
2
+ db: string;
3
+ }
4
+ export declare class IdTypeDto {
5
+ id: number;
6
+ type: number;
7
+ }
8
+ export declare class FeatureDto extends IdTypeDto {
9
+ feature: string;
10
+ }
11
+ export declare class InsertToDBDto extends DBDto {
12
+ data: FeatureDto[];
13
+ }
14
+ export declare class DeleteFromDBDto extends DBDto {
15
+ ids: number[];
16
+ }
17
+ export declare class EraseByTypeDto extends DBDto {
18
+ type: number;
19
+ }
20
+ export declare class UpdateDBDto extends DBDto {
21
+ data: IdTypeDto[];
22
+ }
23
+ export declare class QueryDto extends DBDto {
24
+ features: string[];
25
+ }
26
+ export declare class QueryRes {
27
+ ids: number[];
28
+ types: number[];
29
+ scores: number[];
30
+ }
31
+ export declare class ImageDto {
32
+ src: string;
33
+ srcMask?: string;
34
+ width?: number;
35
+ height?: number;
36
+ channel?: number;
37
+ }
38
+ export declare class FeatureExtractDto extends ImageDto {
39
+ dist: string;
40
+ x: number;
41
+ y: number;
42
+ }
43
+ export declare class FeatureExtractRes {
44
+ feature: string;
45
+ position: number[];
46
+ }
47
+ export declare class CoreLearnDto extends ImageDto {
48
+ db: string;
49
+ normalId?: number;
50
+ threshold: number;
51
+ sampleDir: string;
52
+ learnUntilNone?: boolean;
53
+ featureCount?: number;
54
+ }
55
+ export declare class FeatureRes {
56
+ id: number;
57
+ x: number;
58
+ y: number;
59
+ }
60
+ export declare class CropSamplesDto {
61
+ src: string;
62
+ width: number;
63
+ height: number;
64
+ channel: number;
65
+ sampleDir: string;
66
+ data: FeatureRes[];
67
+ }
68
+ export declare class EraseSamplesDto extends DBDto {
69
+ srcs: string[];
70
+ }
71
+ export declare class SampleDto {
72
+ src: string;
73
+ dist: string;
74
+ }
75
+ export declare class SampleFeatureDto extends SampleDto {
76
+ feature: string;
77
+ }
78
+ export declare class UpdateSamplesDto extends DBDto {
79
+ data: SampleDto[];
80
+ }
81
+ export declare class InsertSamplesDto extends DBDto {
82
+ data: SampleFeatureDto[];
83
+ }