@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 +114 -0
- package/dist/app.controller.d.ts +22 -0
- package/dist/app.controller.js +257 -0
- package/dist/app.controller.js.map +1 -0
- package/dist/app.dto.d.ts +83 -0
- package/dist/app.dto.js +315 -0
- package/dist/app.dto.js.map +1 -0
- package/dist/app.library.d.ts +20 -0
- package/dist/app.library.js +196 -0
- package/dist/app.library.js.map +1 -0
- package/dist/app.module.d.ts +6 -0
- package/dist/app.module.js +26 -0
- package/dist/app.module.js.map +1 -0
- package/dist/app.service.d.ts +152 -0
- package/dist/app.service.js +441 -0
- package/dist/app.service.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +33 -0
- package/dist/main.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +81 -0
package/dist/app.dto.js
ADDED
@@ -0,0 +1,315 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.InsertSamplesDto = exports.UpdateSamplesDto = exports.SampleFeatureDto = exports.SampleDto = exports.EraseSamplesDto = exports.CropSamplesDto = exports.FeatureRes = exports.CoreLearnDto = exports.FeatureExtractRes = exports.FeatureExtractDto = exports.ImageDto = exports.QueryRes = exports.QueryDto = exports.UpdateDBDto = exports.EraseByTypeDto = exports.DeleteFromDBDto = exports.InsertToDBDto = exports.FeatureDto = exports.IdTypeDto = exports.DBDto = void 0;
|
13
|
+
const openapi = require("@nestjs/swagger");
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
15
|
+
const feature = 'AKByOgAggz0AAKM9ACDXOgCg2DwAANE8ACC7PABAtjsAIA09AECCPAAABj0AQOc8AAAAAADAEDwAQLg8AKB6PQAAWTsAwHA8AMDFPQDAiT0AAAAAAMC+OgCgdT0AoJ89AOC5PQBAPT0AYBc9AABdOwCAGD0AYMs8AMA2OwAgBT4AAMA8AEDxOgAAAAAAAAAAAIAJPgBg4DwAAGM9AMCgPADAgDwAwJ08AICoPADgvz0AAAAAACB4PQCArTwAoJ89AGCgPACgXD4AAL47ACCsPAAACj0AYIM9AMCQOwCAtj0AYC88AAAAAADgMz0A4Nw8AMA3PQAgITwAYDk9ACC/PQBgHTwAAAAAAAC9PQBg2j0AADw9AKBxPQAgHzsAQOg9AEDOOwAAAAAAgBs9AEAePgCg5DoA4OY9AKCwPABAujsAgLI9AGAPPQCAbT0AQJw9AABZPQDA3TwA4NM9AED5OwAAVD0AAAAAAEANPAAA7T0AYLs8ACAOPQAAAAAAwKI7AIB3PQAA8D0AQHw8AOC1PACgDz0A4Hs9AKACPAAgNz0AIBk8AADLPQBA1jwAQJw5AKApPQAgoD0AwFc9AAAAAADgMT0AIDI+AAAAAAAAAAAAoJ48AMBaOgBgZjwAQIE9AMDRPQDgsT0AQCU8AKBmPQDA/zwAQN88AGCuPQBAbTwAQO08AKDcOwBAmjwAIJE7AODROwDA6TwAQBI9AKCHPQAAAAAAAAAAAACQOwCA6TwAoA8+AKBYPQDgRzwAYIU9AMDsOgDgZj0AIAw+AGAJPADgvDwAYNE9AAAAAADAiTsAwDQ7AABxPAAgaTwAwDA9AEBePQAAAAAAAMw9AKA2PABAqDwAwIU9AAAAAABgij0AAAA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E9AKBuPAAgazwAwMM8AAAAAADg9zoAYFk9ACCNPQAAADsAgBQ8AGBHPAAAAAAAYCA6AGCpPQDgPD0AACw9AAAAAAAAjjsAoIw8';
|
16
|
+
class DBDto {
|
17
|
+
static _OPENAPI_METADATA_FACTORY() {
|
18
|
+
return { db: { required: true, type: () => String } };
|
19
|
+
}
|
20
|
+
}
|
21
|
+
exports.DBDto = DBDto;
|
22
|
+
__decorate([
|
23
|
+
(0, swagger_1.ApiProperty)({ example: 'test.db', description: 'db路径' }),
|
24
|
+
__metadata("design:type", String)
|
25
|
+
], DBDto.prototype, "db", void 0);
|
26
|
+
class IdTypeDto {
|
27
|
+
static _OPENAPI_METADATA_FACTORY() {
|
28
|
+
return { id: { required: true, type: () => Number }, type: { required: true, type: () => Number } };
|
29
|
+
}
|
30
|
+
}
|
31
|
+
exports.IdTypeDto = IdTypeDto;
|
32
|
+
__decorate([
|
33
|
+
(0, swagger_1.ApiProperty)({ example: 1, description: '主键' }),
|
34
|
+
__metadata("design:type", Number)
|
35
|
+
], IdTypeDto.prototype, "id", void 0);
|
36
|
+
__decorate([
|
37
|
+
(0, swagger_1.ApiProperty)({ example: 102, description: '特征类型' }),
|
38
|
+
__metadata("design:type", Number)
|
39
|
+
], IdTypeDto.prototype, "type", void 0);
|
40
|
+
class FeatureDto extends IdTypeDto {
|
41
|
+
static _OPENAPI_METADATA_FACTORY() {
|
42
|
+
return { feature: { required: true, type: () => String } };
|
43
|
+
}
|
44
|
+
}
|
45
|
+
exports.FeatureDto = FeatureDto;
|
46
|
+
__decorate([
|
47
|
+
(0, swagger_1.ApiProperty)({ example: feature, description: '特征数组转为base64位字符串' }),
|
48
|
+
__metadata("design:type", String)
|
49
|
+
], FeatureDto.prototype, "feature", void 0);
|
50
|
+
class InsertToDBDto extends DBDto {
|
51
|
+
static _OPENAPI_METADATA_FACTORY() {
|
52
|
+
return { data: { required: true, type: () => [require("./app.dto").FeatureDto] } };
|
53
|
+
}
|
54
|
+
}
|
55
|
+
exports.InsertToDBDto = InsertToDBDto;
|
56
|
+
__decorate([
|
57
|
+
(0, swagger_1.ApiProperty)({ description: '数据列表' }),
|
58
|
+
__metadata("design:type", Array)
|
59
|
+
], InsertToDBDto.prototype, "data", void 0);
|
60
|
+
class DeleteFromDBDto extends DBDto {
|
61
|
+
static _OPENAPI_METADATA_FACTORY() {
|
62
|
+
return { ids: { required: true, type: () => [Number] } };
|
63
|
+
}
|
64
|
+
}
|
65
|
+
exports.DeleteFromDBDto = DeleteFromDBDto;
|
66
|
+
__decorate([
|
67
|
+
(0, swagger_1.ApiProperty)({
|
68
|
+
example: [102, 103],
|
69
|
+
description: '删除的id列表',
|
70
|
+
}),
|
71
|
+
__metadata("design:type", Array)
|
72
|
+
], DeleteFromDBDto.prototype, "ids", void 0);
|
73
|
+
class EraseByTypeDto extends DBDto {
|
74
|
+
static _OPENAPI_METADATA_FACTORY() {
|
75
|
+
return { type: { required: true, type: () => Number } };
|
76
|
+
}
|
77
|
+
}
|
78
|
+
exports.EraseByTypeDto = EraseByTypeDto;
|
79
|
+
__decorate([
|
80
|
+
(0, swagger_1.ApiProperty)({ example: 1, description: '删除的特征类型表' }),
|
81
|
+
__metadata("design:type", Number)
|
82
|
+
], EraseByTypeDto.prototype, "type", void 0);
|
83
|
+
class UpdateDBDto extends DBDto {
|
84
|
+
static _OPENAPI_METADATA_FACTORY() {
|
85
|
+
return { data: { required: true, type: () => [require("./app.dto").IdTypeDto] } };
|
86
|
+
}
|
87
|
+
}
|
88
|
+
exports.UpdateDBDto = UpdateDBDto;
|
89
|
+
__decorate([
|
90
|
+
(0, swagger_1.ApiProperty)({ description: '更新数据列表' }),
|
91
|
+
__metadata("design:type", Array)
|
92
|
+
], UpdateDBDto.prototype, "data", void 0);
|
93
|
+
class QueryDto extends DBDto {
|
94
|
+
static _OPENAPI_METADATA_FACTORY() {
|
95
|
+
return { features: { required: true, type: () => [String] } };
|
96
|
+
}
|
97
|
+
}
|
98
|
+
exports.QueryDto = QueryDto;
|
99
|
+
__decorate([
|
100
|
+
(0, swagger_1.ApiProperty)({ example: [feature], description: '特征列表' }),
|
101
|
+
__metadata("design:type", Array)
|
102
|
+
], QueryDto.prototype, "features", void 0);
|
103
|
+
class QueryRes {
|
104
|
+
static _OPENAPI_METADATA_FACTORY() {
|
105
|
+
return { ids: { required: true, type: () => [Number] }, types: { required: true, type: () => [Number] }, scores: { required: true, type: () => [Number] } };
|
106
|
+
}
|
107
|
+
}
|
108
|
+
exports.QueryRes = QueryRes;
|
109
|
+
__decorate([
|
110
|
+
(0, swagger_1.ApiProperty)({ example: [1014, 1734], description: '最近的id列表' }),
|
111
|
+
__metadata("design:type", Array)
|
112
|
+
], QueryRes.prototype, "ids", void 0);
|
113
|
+
__decorate([
|
114
|
+
(0, swagger_1.ApiProperty)({ example: [0, 2], description: '特征类型列表' }),
|
115
|
+
__metadata("design:type", Array)
|
116
|
+
], QueryRes.prototype, "types", void 0);
|
117
|
+
__decorate([
|
118
|
+
(0, swagger_1.ApiProperty)({ example: [0.89, 0.67], description: '分数列表' }),
|
119
|
+
__metadata("design:type", Array)
|
120
|
+
], QueryRes.prototype, "scores", void 0);
|
121
|
+
class ImageDto {
|
122
|
+
constructor() {
|
123
|
+
this.width = 5120;
|
124
|
+
this.height = 5120;
|
125
|
+
}
|
126
|
+
static _OPENAPI_METADATA_FACTORY() {
|
127
|
+
return { src: { required: true, type: () => String }, srcMask: { required: false, type: () => String }, width: { required: false, type: () => Number, default: 5120 }, height: { required: false, type: () => Number, default: 5120 }, channel: { required: false, type: () => Number } };
|
128
|
+
}
|
129
|
+
}
|
130
|
+
exports.ImageDto = ImageDto;
|
131
|
+
__decorate([
|
132
|
+
(0, swagger_1.ApiProperty)({ example: 'D:/kl-storage/gallery/1.bmp', description: '图像地址' }),
|
133
|
+
__metadata("design:type", String)
|
134
|
+
], ImageDto.prototype, "src", void 0);
|
135
|
+
__decorate([
|
136
|
+
(0, swagger_1.ApiProperty)({ example: '', description: '图像对应mask地址' }),
|
137
|
+
__metadata("design:type", String)
|
138
|
+
], ImageDto.prototype, "srcMask", void 0);
|
139
|
+
__decorate([
|
140
|
+
(0, swagger_1.ApiProperty)({ example: 5120, description: '图像宽;默认值为配置文件中的width' }),
|
141
|
+
__metadata("design:type", Number)
|
142
|
+
], ImageDto.prototype, "width", void 0);
|
143
|
+
__decorate([
|
144
|
+
(0, swagger_1.ApiProperty)({ example: 5120, description: '图像高;默认值为配置文件中的height' }),
|
145
|
+
__metadata("design:type", Number)
|
146
|
+
], ImageDto.prototype, "height", void 0);
|
147
|
+
__decorate([
|
148
|
+
(0, swagger_1.ApiProperty)({ example: 3, description: '图像通道;默认值为配置文件中的channel' }),
|
149
|
+
__metadata("design:type", Number)
|
150
|
+
], ImageDto.prototype, "channel", void 0);
|
151
|
+
class FeatureExtractDto extends ImageDto {
|
152
|
+
static _OPENAPI_METADATA_FACTORY() {
|
153
|
+
return { dist: { required: true, type: () => String }, x: { required: true, type: () => Number }, y: { required: true, type: () => Number } };
|
154
|
+
}
|
155
|
+
}
|
156
|
+
exports.FeatureExtractDto = FeatureExtractDto;
|
157
|
+
__decorate([
|
158
|
+
(0, swagger_1.ApiProperty)({ example: 'D:/samples/temp.png', description: '提取出的特征小图的地址' }),
|
159
|
+
__metadata("design:type", String)
|
160
|
+
], FeatureExtractDto.prototype, "dist", void 0);
|
161
|
+
__decorate([
|
162
|
+
(0, swagger_1.ApiProperty)({ example: 100, description: '特征起点x坐标', }),
|
163
|
+
__metadata("design:type", Number)
|
164
|
+
], FeatureExtractDto.prototype, "x", void 0);
|
165
|
+
__decorate([
|
166
|
+
(0, swagger_1.ApiProperty)({ example: 100, description: '特征起点y坐标' }),
|
167
|
+
__metadata("design:type", Number)
|
168
|
+
], FeatureExtractDto.prototype, "y", void 0);
|
169
|
+
class FeatureExtractRes {
|
170
|
+
static _OPENAPI_METADATA_FACTORY() {
|
171
|
+
return { feature: { required: true, type: () => String }, position: { required: true, type: () => [Number] } };
|
172
|
+
}
|
173
|
+
}
|
174
|
+
exports.FeatureExtractRes = FeatureExtractRes;
|
175
|
+
__decorate([
|
176
|
+
(0, swagger_1.ApiProperty)({ description: '特征base64字符串' }),
|
177
|
+
__metadata("design:type", String)
|
178
|
+
], FeatureExtractRes.prototype, "feature", void 0);
|
179
|
+
__decorate([
|
180
|
+
(0, swagger_1.ApiProperty)({ example: [360, 208, 72, 40, 264, 96], description: '特征坐标:[x,y,w,h,cx,cy]', }),
|
181
|
+
__metadata("design:type", Array)
|
182
|
+
], FeatureExtractRes.prototype, "position", void 0);
|
183
|
+
class CoreLearnDto extends ImageDto {
|
184
|
+
static _OPENAPI_METADATA_FACTORY() {
|
185
|
+
return { db: { required: true, type: () => String }, normalId: { required: false, type: () => Number }, threshold: { required: true, type: () => Number }, sampleDir: { required: true, type: () => String }, learnUntilNone: { required: false, type: () => Boolean }, featureCount: { required: false, type: () => Number } };
|
186
|
+
}
|
187
|
+
}
|
188
|
+
exports.CoreLearnDto = CoreLearnDto;
|
189
|
+
__decorate([
|
190
|
+
(0, swagger_1.ApiProperty)({ example: 'test.db', description: 'db路径' }),
|
191
|
+
__metadata("design:type", String)
|
192
|
+
], CoreLearnDto.prototype, "db", void 0);
|
193
|
+
__decorate([
|
194
|
+
(0, swagger_1.ApiProperty)({ required: false, default: 0, example: 0, description: '正常特征的编号', }),
|
195
|
+
__metadata("design:type", Number)
|
196
|
+
], CoreLearnDto.prototype, "normalId", void 0);
|
197
|
+
__decorate([
|
198
|
+
(0, swagger_1.ApiProperty)({ example: 0.9, description: '提取特征的阈值' }),
|
199
|
+
__metadata("design:type", Number)
|
200
|
+
], CoreLearnDto.prototype, "threshold", void 0);
|
201
|
+
__decorate([
|
202
|
+
(0, swagger_1.ApiProperty)({ example: 'C:/101.正常/', description: '对应的sample小图的目录' }),
|
203
|
+
__metadata("design:type", String)
|
204
|
+
], CoreLearnDto.prototype, "sampleDir", void 0);
|
205
|
+
__decorate([
|
206
|
+
(0, swagger_1.ApiProperty)({ required: false, default: false, example: true, description: '是否一次性提取所有特征' }),
|
207
|
+
__metadata("design:type", Boolean)
|
208
|
+
], CoreLearnDto.prototype, "learnUntilNone", void 0);
|
209
|
+
__decorate([
|
210
|
+
(0, swagger_1.ApiProperty)({ required: false, default: 1024, example: 1024, description: '一次提取的特征数' }),
|
211
|
+
__metadata("design:type", Number)
|
212
|
+
], CoreLearnDto.prototype, "featureCount", void 0);
|
213
|
+
class FeatureRes {
|
214
|
+
static _OPENAPI_METADATA_FACTORY() {
|
215
|
+
return { id: { required: true, type: () => Number }, x: { required: true, type: () => Number }, y: { required: true, type: () => Number } };
|
216
|
+
}
|
217
|
+
}
|
218
|
+
exports.FeatureRes = FeatureRes;
|
219
|
+
__decorate([
|
220
|
+
(0, swagger_1.ApiProperty)({ example: -1, description: '特征编号;正常特征的编号为负数' }),
|
221
|
+
__metadata("design:type", Number)
|
222
|
+
], FeatureRes.prototype, "id", void 0);
|
223
|
+
__decorate([
|
224
|
+
(0, swagger_1.ApiProperty)({ example: 234, description: '特征起点x' }),
|
225
|
+
__metadata("design:type", Number)
|
226
|
+
], FeatureRes.prototype, "x", void 0);
|
227
|
+
__decorate([
|
228
|
+
(0, swagger_1.ApiProperty)({ example: 23, description: '特征起点y' }),
|
229
|
+
__metadata("design:type", Number)
|
230
|
+
], FeatureRes.prototype, "y", void 0);
|
231
|
+
class CropSamplesDto {
|
232
|
+
static _OPENAPI_METADATA_FACTORY() {
|
233
|
+
return { src: { required: true, type: () => String }, width: { required: true, type: () => Number }, height: { required: true, type: () => Number }, channel: { required: true, type: () => Number }, sampleDir: { required: true, type: () => String }, data: { required: true, type: () => [require("./app.dto").FeatureRes] } };
|
234
|
+
}
|
235
|
+
}
|
236
|
+
exports.CropSamplesDto = CropSamplesDto;
|
237
|
+
__decorate([
|
238
|
+
(0, swagger_1.ApiProperty)({ example: 'D:/kl-storage/gallery/1.bmp', description: '被裁剪图像的地址' }),
|
239
|
+
__metadata("design:type", String)
|
240
|
+
], CropSamplesDto.prototype, "src", void 0);
|
241
|
+
__decorate([
|
242
|
+
(0, swagger_1.ApiProperty)({ required: false, example: 5120, description: '图像宽;默认值为配置文件中的width' }),
|
243
|
+
__metadata("design:type", Number)
|
244
|
+
], CropSamplesDto.prototype, "width", void 0);
|
245
|
+
__decorate([
|
246
|
+
(0, swagger_1.ApiProperty)({ required: false, example: 5120, description: '图像高;默认值为配置文件中的height' }),
|
247
|
+
__metadata("design:type", Number)
|
248
|
+
], CropSamplesDto.prototype, "height", void 0);
|
249
|
+
__decorate([
|
250
|
+
(0, swagger_1.ApiProperty)({ required: false, example: 3, description: '图像通道;默认值为配置文件中的channel' }),
|
251
|
+
__metadata("design:type", Number)
|
252
|
+
], CropSamplesDto.prototype, "channel", void 0);
|
253
|
+
__decorate([
|
254
|
+
(0, swagger_1.ApiProperty)({ example: 'D:/kl-storage/gallery/samples/', description: '对应的sample小图的目录' }),
|
255
|
+
__metadata("design:type", String)
|
256
|
+
], CropSamplesDto.prototype, "sampleDir", void 0);
|
257
|
+
__decorate([
|
258
|
+
(0, swagger_1.ApiProperty)({ description: 'sample小图裁剪相对于src的坐标列表' }),
|
259
|
+
__metadata("design:type", Array)
|
260
|
+
], CropSamplesDto.prototype, "data", void 0);
|
261
|
+
class EraseSamplesDto extends DBDto {
|
262
|
+
static _OPENAPI_METADATA_FACTORY() {
|
263
|
+
return { srcs: { required: true, type: () => [String] } };
|
264
|
+
}
|
265
|
+
}
|
266
|
+
exports.EraseSamplesDto = EraseSamplesDto;
|
267
|
+
__decorate([
|
268
|
+
(0, swagger_1.ApiProperty)({ example: ['D:/kl-storage/gallery/-1.png'], description: 'sample小图地址列表' }),
|
269
|
+
__metadata("design:type", Array)
|
270
|
+
], EraseSamplesDto.prototype, "srcs", void 0);
|
271
|
+
class SampleDto {
|
272
|
+
static _OPENAPI_METADATA_FACTORY() {
|
273
|
+
return { src: { required: true, type: () => String }, dist: { required: true, type: () => String } };
|
274
|
+
}
|
275
|
+
}
|
276
|
+
exports.SampleDto = SampleDto;
|
277
|
+
__decorate([
|
278
|
+
(0, swagger_1.ApiProperty)({ example: 'D:/kl-storage/gallery/-1.png', description: 'sample小图原地址' }),
|
279
|
+
__metadata("design:type", String)
|
280
|
+
], SampleDto.prototype, "src", void 0);
|
281
|
+
__decorate([
|
282
|
+
(0, swagger_1.ApiProperty)({ example: 'D:/kl-storage/gallery/-1.png', description: 'sample小图目标地址' }),
|
283
|
+
__metadata("design:type", String)
|
284
|
+
], SampleDto.prototype, "dist", void 0);
|
285
|
+
class SampleFeatureDto extends SampleDto {
|
286
|
+
static _OPENAPI_METADATA_FACTORY() {
|
287
|
+
return { feature: { required: true, type: () => String } };
|
288
|
+
}
|
289
|
+
}
|
290
|
+
exports.SampleFeatureDto = SampleFeatureDto;
|
291
|
+
__decorate([
|
292
|
+
(0, swagger_1.ApiProperty)({ example: feature, description: '特征数组转为base64位字符串' }),
|
293
|
+
__metadata("design:type", String)
|
294
|
+
], SampleFeatureDto.prototype, "feature", void 0);
|
295
|
+
class UpdateSamplesDto extends DBDto {
|
296
|
+
static _OPENAPI_METADATA_FACTORY() {
|
297
|
+
return { data: { required: true, type: () => [require("./app.dto").SampleDto] } };
|
298
|
+
}
|
299
|
+
}
|
300
|
+
exports.UpdateSamplesDto = UpdateSamplesDto;
|
301
|
+
__decorate([
|
302
|
+
(0, swagger_1.ApiProperty)({ description: 'sample小图地址列表' }),
|
303
|
+
__metadata("design:type", Array)
|
304
|
+
], UpdateSamplesDto.prototype, "data", void 0);
|
305
|
+
class InsertSamplesDto extends DBDto {
|
306
|
+
static _OPENAPI_METADATA_FACTORY() {
|
307
|
+
return { data: { required: true, type: () => [require("./app.dto").SampleFeatureDto] } };
|
308
|
+
}
|
309
|
+
}
|
310
|
+
exports.InsertSamplesDto = InsertSamplesDto;
|
311
|
+
__decorate([
|
312
|
+
(0, swagger_1.ApiProperty)({ description: 'sample小图地址列表' }),
|
313
|
+
__metadata("design:type", Array)
|
314
|
+
], InsertSamplesDto.prototype, "data", void 0);
|
315
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AAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;;iDACxE;AAGlB;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;;4CACnC;AAGrB,MAAa,eAAgB,SAAQ,KAAK;;;;CAGzC;AAHD,0CAGC;AADC;IADC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,CAAC,8BAA8B,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;6CACzE;AAGjB,MAAa,SAAS;;;;CAMrB;AAND,8BAMC;AAJC;IADC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;;sCACzE;AAGZ;IADC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;uCACzE;AAGf,MAAa,gBAAiB,SAAQ,SAAS;;;;CAG9C;AAHD,4CAGC;AADC;IADC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;;iDACnD;AAGlB,MAAa,gBAAiB,SAAQ,KAAK;;;;CAG1C;AAHD,4CAGC;AADC;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;8CAC3B;AAGpB,MAAa,gBAAiB,SAAQ,KAAK;;;;CAG1C;AAHD,4CAGC;AADC;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;8CACpB"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import ref from 'ref-napi';
|
2
|
+
export declare const anomaly: (dllPath: string) => {
|
3
|
+
get_dll_version: import("ffi-napi").ForeignFunction<string, []>;
|
4
|
+
initEngine: import("ffi-napi").ForeignFunction<boolean, [string, number, number, number, number, number]>;
|
5
|
+
destroyEngine: import("ffi-napi").ForeignFunction<boolean, []>;
|
6
|
+
coreLearn: import("ffi-napi").ForeignFunction<number, [string, ref.Pointer<number>, ref.Pointer<number>, number, number, number, number, number, number, ref.Pointer<number>]>;
|
7
|
+
featureExtract: import("ffi-napi").ForeignFunction<boolean, [ref.Pointer<number>, number, number, number, ref.Pointer<number>, ref.Pointer<number>]>;
|
8
|
+
erase: import("ffi-napi").ForeignFunction<number, [string, number, ref.Pointer<number>]>;
|
9
|
+
erase_type: import("ffi-napi").ForeignFunction<number, [string, number]>;
|
10
|
+
load_DB: import("ffi-napi").ForeignFunction<number, [string]>;
|
11
|
+
release_DB: import("ffi-napi").ForeignFunction<boolean, [string]>;
|
12
|
+
insert: import("ffi-napi").ForeignFunction<number, [string, number, ref.Pointer<number>, ref.Pointer<number>, ref.Pointer<number>]>;
|
13
|
+
update: import("ffi-napi").ForeignFunction<number, [string, number, ref.Pointer<number>, ref.Pointer<number>, ref.Pointer<number>]>;
|
14
|
+
query: import("ffi-napi").ForeignFunction<boolean, [string, number, ref.Pointer<number>, ref.Pointer<number>, ref.Pointer<number>, ref.Pointer<number>]>;
|
15
|
+
};
|
16
|
+
export declare const shmem: (dllPath: string) => {
|
17
|
+
copy: import("ffi-napi").ForeignFunction<void, [ref.Pointer<number>, number, number, ref.Pointer<number>, ref.Pointer<number>, number, number, ref.Pointer<number>, number]>;
|
18
|
+
imread: import("ffi-napi").ForeignFunction<boolean, [string, ref.Pointer<number>, number, number, number, boolean]>;
|
19
|
+
imwrite: import("ffi-napi").ForeignFunction<boolean, [string, ref.Pointer<number>, number, number, number, boolean]>;
|
20
|
+
};
|
@@ -0,0 +1,196 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
+
};
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
+
exports.shmem = exports.anomaly = void 0;
|
30
|
+
const path = __importStar(require("path"));
|
31
|
+
const ref_napi_1 = __importDefault(require("ref-napi"));
|
32
|
+
const ffi_napi_1 = require("ffi-napi");
|
33
|
+
const { void: _void, CString, uchar, int, int32, float, bool } = ref_napi_1.default.types;
|
34
|
+
const FloatArrayPtr = ref_napi_1.default.refType(float);
|
35
|
+
const IntArrayPtr = ref_napi_1.default.refType(int32);
|
36
|
+
const UChanrArrayPtr = ref_napi_1.default.refType(uchar);
|
37
|
+
const anomaly = (dllPath) => {
|
38
|
+
const anomaly = new ffi_napi_1.Library(path.join(dllPath, 'anomaly'), {
|
39
|
+
/**
|
40
|
+
* 获取dll版本信息
|
41
|
+
* @return 版本号
|
42
|
+
*/
|
43
|
+
get_dll_version: [CString, []],
|
44
|
+
/**
|
45
|
+
* 初始化引擎
|
46
|
+
* @param args_0 [in]dbPath目录
|
47
|
+
* @param args_1 [in]批处理数量
|
48
|
+
* @param args_2 [in]引擎通道
|
49
|
+
* @param args_3 [in]引擎高
|
50
|
+
* @param args_4 [in]引擎宽
|
51
|
+
* @param args_5 [in]特征维度
|
52
|
+
* @returns 是否成功
|
53
|
+
*/
|
54
|
+
initEngine: [bool, [CString, int, int, int, int, int]],
|
55
|
+
/**
|
56
|
+
* 关闭引擎
|
57
|
+
* @returns 是否成功
|
58
|
+
*/
|
59
|
+
destroyEngine: [bool, []],
|
60
|
+
/**
|
61
|
+
* 提取全图特征
|
62
|
+
* @param args_0 [in]db名称
|
63
|
+
* @param args_1 [in]图像buffer
|
64
|
+
* @param args_2 [in]maskBuffer
|
65
|
+
* @param args_3 [in]高
|
66
|
+
* @param args_4 [in]宽
|
67
|
+
* @param args_5 [in]通道
|
68
|
+
* @param args_6 [in]正常类型的id;***应为0*
|
69
|
+
* @param args_7 [in]提取特征的最大数
|
70
|
+
* @param args_8 [in]相似阈值
|
71
|
+
* @param args_9 [out:float]特征结果数组;[id,type,...]
|
72
|
+
* @returns db的特征总条数
|
73
|
+
*/
|
74
|
+
coreLearn: [
|
75
|
+
int,
|
76
|
+
[CString, UChanrArrayPtr, UChanrArrayPtr, int, int, int, int, int, float, FloatArrayPtr],
|
77
|
+
],
|
78
|
+
/**
|
79
|
+
* 提取特征
|
80
|
+
* @param args_0 [in]图像buffer
|
81
|
+
* @param args_1 [in]高
|
82
|
+
* @param args_2 [in]宽
|
83
|
+
* @param args_3 [in]通道
|
84
|
+
* @param args_4 [in:int]缺陷在小图上的坐标:[x,y]
|
85
|
+
* @param args_5 [out:float]提取的特征
|
86
|
+
* @returns 是否成功
|
87
|
+
*/
|
88
|
+
featureExtract: [bool, [UChanrArrayPtr, int, int, int, FloatArrayPtr, FloatArrayPtr]],
|
89
|
+
/**
|
90
|
+
* 删除数据
|
91
|
+
* @param args_0 [in]db名称
|
92
|
+
* @param args_1 [in]删除的总数量
|
93
|
+
* @param args_2 [in:int]删除的id列表
|
94
|
+
* @returns 操作之后db的特征总条数
|
95
|
+
*/
|
96
|
+
erase: [int, [CString, int, IntArrayPtr]],
|
97
|
+
/**
|
98
|
+
* 根据缺陷类型删除db数据
|
99
|
+
* @param args_0 [in]db名称
|
100
|
+
* @param args_1 [in]缺陷类型
|
101
|
+
* @returns 操作之后db的特征总条数
|
102
|
+
*/
|
103
|
+
erase_type: [int, [CString, int]],
|
104
|
+
/**
|
105
|
+
* 加载数据集(没有的话会自动创建)
|
106
|
+
* @param args_0 [in]db名称
|
107
|
+
* @returns db的特征总条数
|
108
|
+
*/
|
109
|
+
load_DB: [int, [CString]],
|
110
|
+
/**
|
111
|
+
* 释放数据集
|
112
|
+
* @param args_0 [in]db名称
|
113
|
+
* @returns 是否成功
|
114
|
+
*/
|
115
|
+
release_DB: [bool, [CString]],
|
116
|
+
/**
|
117
|
+
* 插入数据
|
118
|
+
* @param args_0 [in]db名称
|
119
|
+
* @param args_1 [in]插入的总数量
|
120
|
+
* @param args_2 [in:int]id列表
|
121
|
+
* @param args_3 [in:int]type列表
|
122
|
+
* @param args_4 [in:float]feature列表
|
123
|
+
* @returns db的特征总条数
|
124
|
+
*/
|
125
|
+
insert: [int, [CString, int, IntArrayPtr, IntArrayPtr, FloatArrayPtr]],
|
126
|
+
/**
|
127
|
+
* 批量更新数据
|
128
|
+
* @param args_0 [in]db名称
|
129
|
+
* @param args_1 [in]更新总数量
|
130
|
+
* @param args_2 [in:int]id列表
|
131
|
+
* @param args_3 [in:int]type列表
|
132
|
+
* @param args_4 [in:float]feature列表;**可为空**
|
133
|
+
* @returns 更新数目
|
134
|
+
*/
|
135
|
+
update: [int, [CString, int, IntArrayPtr, IntArrayPtr, FloatArrayPtr]],
|
136
|
+
/**
|
137
|
+
* 查询
|
138
|
+
* @param args_0 [in]db名称
|
139
|
+
* @param args_1 [in]查询数量
|
140
|
+
* @param args_2 [in:float]feature列表
|
141
|
+
* @param args_3 [out:float]最近距离score
|
142
|
+
* @param args_4 [out:int]type列表
|
143
|
+
* @param args_5 [out:int]id列表
|
144
|
+
* @returns 是否成功
|
145
|
+
*/
|
146
|
+
query: [bool, [CString, int, FloatArrayPtr, FloatArrayPtr, IntArrayPtr, IntArrayPtr]],
|
147
|
+
});
|
148
|
+
console.log(anomaly.get_dll_version());
|
149
|
+
return anomaly;
|
150
|
+
};
|
151
|
+
exports.anomaly = anomaly;
|
152
|
+
const shmem = (dllPath) => {
|
153
|
+
const shmem = new ffi_napi_1.Library(path.join(dllPath, 'og-common'), {
|
154
|
+
/**
|
155
|
+
* 图像复制,将src的src_roi区域复制至dst的dst_roi区域
|
156
|
+
* @param args_0 [in]原图像buffer
|
157
|
+
* @param args_1 [in]原图像高
|
158
|
+
* @param args_2 [in]原图像宽
|
159
|
+
* @param args_3 [in:int]原图的感兴趣区域:[x,y,w,h]
|
160
|
+
* @param args_4 [in/out]目标图的数据指针
|
161
|
+
* @param args_5 [in]目标图的高
|
162
|
+
* @param args_6 [in]目标图的宽
|
163
|
+
* @param args_7 [in:int]目标图的感兴趣区域:[x,y,w,h]
|
164
|
+
* @param args_8 [in]图像通道
|
165
|
+
*/
|
166
|
+
copy: [
|
167
|
+
_void,
|
168
|
+
[UChanrArrayPtr, int, int, IntArrayPtr, UChanrArrayPtr, int, int, IntArrayPtr, int],
|
169
|
+
],
|
170
|
+
/**
|
171
|
+
* 读图
|
172
|
+
* @param args_0 [in]图像地址
|
173
|
+
* @param args_1 [out]图像buffer
|
174
|
+
* @param args_2 [in]图像擎高
|
175
|
+
* @param args_3 [in]图像宽
|
176
|
+
* @param args_4 [in]图像通道
|
177
|
+
* @param args_5 [in]是否是utf-8
|
178
|
+
* @returns 是否成功
|
179
|
+
*/
|
180
|
+
imread: [bool, [CString, UChanrArrayPtr, int, int, int, bool]],
|
181
|
+
/**
|
182
|
+
* 写图
|
183
|
+
* @param args_0 [in]图像地址
|
184
|
+
* @param args_1 [in]图像buffer
|
185
|
+
* @param args_2 [in]图像擎高
|
186
|
+
* @param args_3 [in]图像宽
|
187
|
+
* @param args_4 [in]图像通道
|
188
|
+
* @param args_5 [in]是否是utf-8
|
189
|
+
* @returns 是否成功
|
190
|
+
*/
|
191
|
+
imwrite: [bool, [CString, UChanrArrayPtr, int, int, int, bool]],
|
192
|
+
});
|
193
|
+
return shmem;
|
194
|
+
};
|
195
|
+
exports.shmem = shmem;
|
196
|
+
//# sourceMappingURL=app.library.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"app.library.js","sourceRoot":"","sources":["../src/app.library.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,wDAA2B;AAC3B,uCAAmC;AACnC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,kBAAG,CAAC,KAAK,CAAC;AAC3E,MAAM,aAAa,GAAG,kBAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACzC,MAAM,WAAW,GAAG,kBAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACvC,MAAM,cAAc,GAAG,kBAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAGnC,MAAM,OAAO,GAAG,CAAC,OAAe,EAAE,EAAE;IACzC,MAAM,OAAO,GAAG,IAAI,kBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;QACzD;;;WAGG;QACH,eAAe,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QAC9B;;;;;;;;;WASG;QACH,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACtD;;;WAGG;QACH,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;QACzB;;;;;;;;;;;;;WAaG;QACH,SAAS,EAAE;YACT,GAAG;YACH,CAAC,OAAO,EAAE,cAAc,EAAE,c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AAI,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE;QACzD;;;;;;;;;;;WAWG;QACH,IAAI,EAAE;YACJ,KAAK;YACL,CAAC,cAAc,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,CAAC;SACpF;QACD;;;;;;;;;WASG;QACH,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAC9D;;;;;;;;;WASG;QACH,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;KAChE,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AA3CW,QAAA,KAAK,SA2ChB"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
2
|
+
import { AppService, KLConfig } from './app.service';
|
3
|
+
export declare class AppModule {
|
4
|
+
static forRoot(options?: Partial<KLConfig>): DynamicModule;
|
5
|
+
}
|
6
|
+
export { AppModule as AOIDBModule, AppService as AOIDBService };
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AOIDBService = exports.AOIDBModule = exports.AppModule = void 0;
|
4
|
+
const app_controller_1 = require("./app.controller");
|
5
|
+
const app_service_1 = require("./app.service");
|
6
|
+
Object.defineProperty(exports, "AOIDBService", { enumerable: true, get: function () { return app_service_1.AppService; } });
|
7
|
+
class AppModule {
|
8
|
+
static forRoot(options) {
|
9
|
+
return {
|
10
|
+
global: true,
|
11
|
+
module: AppModule,
|
12
|
+
controllers: [app_controller_1.AppController],
|
13
|
+
providers: [
|
14
|
+
{
|
15
|
+
provide: 'CONFIG_OPTIONS',
|
16
|
+
useValue: options,
|
17
|
+
},
|
18
|
+
app_service_1.AppService,
|
19
|
+
],
|
20
|
+
exports: [app_service_1.AppService],
|
21
|
+
};
|
22
|
+
}
|
23
|
+
}
|
24
|
+
exports.AppModule = AppModule;
|
25
|
+
exports.AOIDBModule = AppModule;
|
26
|
+
//# sourceMappingURL=app.module.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;AACA,qDAAiD;AACjD,+CAAqD;AAoBJ,6FApBxC,wBAAU,OAoB0C;AAlB7D,MAAa,SAAS;IACpB,MAAM,CAAC,OAAO,CAAC,OAA2B;QACxC,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,SAAS;YACjB,WAAW,EAAE,CAAC,8BAAa,CAAC;YAC5B,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,gBAAgB;oBACzB,QAAQ,EAAE,OAAO;iBAClB;gBACD,wBAAU;aACX;YACD,OAAO,EAAE,CAAC,wBAAU,CAAC;SACtB,CAAC;IACJ,CAAC;CACF;AAhBD,8BAgBC;AAEqB,gCAAW"}
|