learning_model 1.0.18 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/jest.config.js +6 -0
- package/lib/learning/mobilenet_image.test.ts +44 -0
- package/{src → lib}/learning/mobilenet_image.ts +3 -1
- package/lib/learning/util.ts +15 -0
- package/package.json +5 -4
- package/tsconfig.json +4 -6
- package/dist/index.bundle.js +0 -2
- package/dist/index.bundle.js.LICENSE.txt +0 -335
- package/dist/index.js +0 -10
- package/dist/types/index.d.ts +0 -3
- package/dist/types/learning/base.d.ts +0 -19
- package/dist/types/learning/base.js +0 -2
- package/dist/types/learning/image.d.ts +0 -40
- package/dist/types/learning/image.js +0 -259
- package/dist/types/learning/mobilenet_image.d.ts +0 -42
- package/dist/types/learning/mobilenet_image.js +0 -262
- package/dist/types/learning/mobilenet_image.test.d.ts +0 -1
- package/dist/types/public/index.d.ts +0 -1
- package/dist/types/src/index.d.ts +0 -3
- package/dist/types/src/learning/base.d.ts +0 -19
- package/dist/types/src/learning/image.d.ts +0 -40
- package/dist/types/src/learning/mobilenet_image.d.ts +0 -42
- package/public/index.css +0 -7
- package/public/index.html +0 -15
- package/public/index.ts +0 -153
- package/src/learning/mobilenet_image.test.ts +0 -63
- package/types/index.d.ts +0 -3
- package/types/learning/base.d.ts +0 -19
- package/types/learning/image.d.ts +0 -40
- package/types/learning/mobilenet_image.d.ts +0 -42
- package/types/learning/mobilenet_image.test.d.ts +0 -1
- package/types/public/index.d.ts +0 -1
- package/types/src/index.d.ts +0 -3
- package/types/src/learning/base.d.ts +0 -19
- package/types/src/learning/image.d.ts +0 -40
- package/types/src/learning/mobilenet_image.d.ts +0 -42
- /package/{src → lib}/index.ts +0 -0
- /package/{src → lib}/learning/base.ts +0 -0
- /package/{src → lib}/learning/image.ts +0 -0
package/types/learning/base.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as tf from '@tensorflow/tfjs';
|
|
2
|
-
interface LearningInterface {
|
|
3
|
-
model: tf.LayersModel | null;
|
|
4
|
-
labels: string[];
|
|
5
|
-
isRunning: boolean;
|
|
6
|
-
isReady: boolean;
|
|
7
|
-
onProgress(progress: number): void;
|
|
8
|
-
onLoss(loss: number): void;
|
|
9
|
-
onEvents(logs: any): void;
|
|
10
|
-
onTrainBegin(log: any): void;
|
|
11
|
-
onTrainEnd(log: any): void;
|
|
12
|
-
addData(label: string, data: any): Promise<void>;
|
|
13
|
-
train(): Promise<tf.History>;
|
|
14
|
-
infer(data: any): Promise<any>;
|
|
15
|
-
saveModel(): void;
|
|
16
|
-
running(): boolean;
|
|
17
|
-
ready(): boolean;
|
|
18
|
-
}
|
|
19
|
-
export default LearningInterface;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as tf from '@tensorflow/tfjs';
|
|
2
|
-
import LearningInterface from './base';
|
|
3
|
-
declare class LearningImage implements LearningInterface {
|
|
4
|
-
model: tf.LayersModel | null;
|
|
5
|
-
epochs: number;
|
|
6
|
-
batchSize: number;
|
|
7
|
-
learningRate: number;
|
|
8
|
-
labels: string[];
|
|
9
|
-
isRunning: boolean;
|
|
10
|
-
isReady: boolean;
|
|
11
|
-
limitSize: number;
|
|
12
|
-
trainImages: tf.Tensor3D[];
|
|
13
|
-
readonly MOBILE_NET_INPUT_WIDTH = 224;
|
|
14
|
-
readonly MOBILE_NET_INPUT_HEIGHT = 224;
|
|
15
|
-
readonly MOBILE_NET_INPUT_CHANNEL = 3;
|
|
16
|
-
readonly IMAGE_NORMALIZATION_FACTOR = 255;
|
|
17
|
-
constructor({ epochs, batchSize, limitSize, learningRate, }?: {
|
|
18
|
-
modelURL?: string;
|
|
19
|
-
epochs?: number;
|
|
20
|
-
batchSize?: number;
|
|
21
|
-
limitSize?: number;
|
|
22
|
-
learningRate?: number;
|
|
23
|
-
});
|
|
24
|
-
onProgress: (progress: number) => void;
|
|
25
|
-
onLoss: (loss: number) => void;
|
|
26
|
-
onEvents: (logs: any) => void;
|
|
27
|
-
onTrainBegin: (log: any) => void;
|
|
28
|
-
onTrainEnd: (log: any) => void;
|
|
29
|
-
addData(label: string, data: any): Promise<void>;
|
|
30
|
-
train(): Promise<tf.History>;
|
|
31
|
-
infer(data: any): Promise<Map<string, number>>;
|
|
32
|
-
saveModel(): void;
|
|
33
|
-
running(): boolean;
|
|
34
|
-
ready(): boolean;
|
|
35
|
-
private _preprocessedTargetData;
|
|
36
|
-
private _preprocessedInputData;
|
|
37
|
-
private _preprocessData;
|
|
38
|
-
private _createModel;
|
|
39
|
-
}
|
|
40
|
-
export default LearningImage;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as tf from '@tensorflow/tfjs';
|
|
2
|
-
import LearningInterface from './base';
|
|
3
|
-
declare class LearningMobilenetImage implements LearningInterface {
|
|
4
|
-
model: tf.LayersModel | null;
|
|
5
|
-
epochs: number;
|
|
6
|
-
batchSize: number;
|
|
7
|
-
learningRate: number;
|
|
8
|
-
labels: string[];
|
|
9
|
-
modelURL: string;
|
|
10
|
-
isRunning: boolean;
|
|
11
|
-
isReady: boolean;
|
|
12
|
-
limitSize: number;
|
|
13
|
-
trainImages: tf.Tensor3D[];
|
|
14
|
-
readonly MOBILE_NET_INPUT_WIDTH = 224;
|
|
15
|
-
readonly MOBILE_NET_INPUT_HEIGHT = 224;
|
|
16
|
-
readonly MOBILE_NET_INPUT_CHANNEL = 3;
|
|
17
|
-
readonly IMAGE_NORMALIZATION_FACTOR = 255;
|
|
18
|
-
constructor({ modelURL, // 디폴트 mobilenet 이미지
|
|
19
|
-
epochs, batchSize, limitSize, learningRate, }?: {
|
|
20
|
-
modelURL?: string;
|
|
21
|
-
epochs?: number;
|
|
22
|
-
batchSize?: number;
|
|
23
|
-
limitSize?: number;
|
|
24
|
-
learningRate?: number;
|
|
25
|
-
});
|
|
26
|
-
onProgress: (progress: number) => void;
|
|
27
|
-
onLoss: (loss: number) => void;
|
|
28
|
-
onEvents: (logs: any) => void;
|
|
29
|
-
onTrainBegin: (log: any) => void;
|
|
30
|
-
onTrainEnd: (log: any) => void;
|
|
31
|
-
addData(label: string, data: any): Promise<void>;
|
|
32
|
-
train(): Promise<tf.History>;
|
|
33
|
-
infer(data: any): Promise<Map<string, number>>;
|
|
34
|
-
saveModel(): void;
|
|
35
|
-
running(): boolean;
|
|
36
|
-
ready(): boolean;
|
|
37
|
-
private _preprocessedTargetData;
|
|
38
|
-
private _preprocessedInputData;
|
|
39
|
-
private _preprocessData;
|
|
40
|
-
private _createModel;
|
|
41
|
-
}
|
|
42
|
-
export default LearningMobilenetImage;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/public/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/src/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as tf from '@tensorflow/tfjs';
|
|
2
|
-
interface LearningInterface {
|
|
3
|
-
model: tf.LayersModel | null;
|
|
4
|
-
labels: string[];
|
|
5
|
-
isRunning: boolean;
|
|
6
|
-
isReady: boolean;
|
|
7
|
-
onProgress(progress: number): void;
|
|
8
|
-
onLoss(loss: number): void;
|
|
9
|
-
onEvents(logs: any): void;
|
|
10
|
-
onTrainBegin(log: any): void;
|
|
11
|
-
onTrainEnd(log: any): void;
|
|
12
|
-
addData(label: string, data: any): Promise<void>;
|
|
13
|
-
train(): Promise<tf.History>;
|
|
14
|
-
infer(data: any): Promise<any>;
|
|
15
|
-
saveModel(): void;
|
|
16
|
-
running(): boolean;
|
|
17
|
-
ready(): boolean;
|
|
18
|
-
}
|
|
19
|
-
export default LearningInterface;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as tf from '@tensorflow/tfjs';
|
|
2
|
-
import LearningInterface from './base';
|
|
3
|
-
declare class LearningImage implements LearningInterface {
|
|
4
|
-
model: tf.LayersModel | null;
|
|
5
|
-
epochs: number;
|
|
6
|
-
batchSize: number;
|
|
7
|
-
learningRate: number;
|
|
8
|
-
labels: string[];
|
|
9
|
-
isRunning: boolean;
|
|
10
|
-
isReady: boolean;
|
|
11
|
-
limitSize: number;
|
|
12
|
-
trainImages: tf.Tensor3D[];
|
|
13
|
-
readonly MOBILE_NET_INPUT_WIDTH = 224;
|
|
14
|
-
readonly MOBILE_NET_INPUT_HEIGHT = 224;
|
|
15
|
-
readonly MOBILE_NET_INPUT_CHANNEL = 3;
|
|
16
|
-
readonly IMAGE_NORMALIZATION_FACTOR = 255;
|
|
17
|
-
constructor({ epochs, batchSize, limitSize, learningRate, }?: {
|
|
18
|
-
modelURL?: string;
|
|
19
|
-
epochs?: number;
|
|
20
|
-
batchSize?: number;
|
|
21
|
-
limitSize?: number;
|
|
22
|
-
learningRate?: number;
|
|
23
|
-
});
|
|
24
|
-
onProgress: (progress: number) => void;
|
|
25
|
-
onLoss: (loss: number) => void;
|
|
26
|
-
onEvents: (logs: any) => void;
|
|
27
|
-
onTrainBegin: (log: any) => void;
|
|
28
|
-
onTrainEnd: (log: any) => void;
|
|
29
|
-
addData(label: string, data: any): Promise<void>;
|
|
30
|
-
train(): Promise<tf.History>;
|
|
31
|
-
infer(data: any): Promise<Map<string, number>>;
|
|
32
|
-
saveModel(): void;
|
|
33
|
-
running(): boolean;
|
|
34
|
-
ready(): boolean;
|
|
35
|
-
private _preprocessedTargetData;
|
|
36
|
-
private _preprocessedInputData;
|
|
37
|
-
private _preprocessData;
|
|
38
|
-
private _createModel;
|
|
39
|
-
}
|
|
40
|
-
export default LearningImage;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as tf from '@tensorflow/tfjs';
|
|
2
|
-
import LearningInterface from './base';
|
|
3
|
-
declare class LearningMobilenetImage implements LearningInterface {
|
|
4
|
-
model: tf.LayersModel | null;
|
|
5
|
-
epochs: number;
|
|
6
|
-
batchSize: number;
|
|
7
|
-
learningRate: number;
|
|
8
|
-
labels: string[];
|
|
9
|
-
modelURL: string;
|
|
10
|
-
isRunning: boolean;
|
|
11
|
-
isReady: boolean;
|
|
12
|
-
limitSize: number;
|
|
13
|
-
trainImages: tf.Tensor3D[];
|
|
14
|
-
readonly MOBILE_NET_INPUT_WIDTH = 224;
|
|
15
|
-
readonly MOBILE_NET_INPUT_HEIGHT = 224;
|
|
16
|
-
readonly MOBILE_NET_INPUT_CHANNEL = 3;
|
|
17
|
-
readonly IMAGE_NORMALIZATION_FACTOR = 255;
|
|
18
|
-
constructor({ modelURL, // 디폴트 mobilenet 이미지
|
|
19
|
-
epochs, batchSize, limitSize, learningRate, }?: {
|
|
20
|
-
modelURL?: string;
|
|
21
|
-
epochs?: number;
|
|
22
|
-
batchSize?: number;
|
|
23
|
-
limitSize?: number;
|
|
24
|
-
learningRate?: number;
|
|
25
|
-
});
|
|
26
|
-
onProgress: (progress: number) => void;
|
|
27
|
-
onLoss: (loss: number) => void;
|
|
28
|
-
onEvents: (logs: any) => void;
|
|
29
|
-
onTrainBegin: (log: any) => void;
|
|
30
|
-
onTrainEnd: (log: any) => void;
|
|
31
|
-
addData(label: string, data: any): Promise<void>;
|
|
32
|
-
train(): Promise<tf.History>;
|
|
33
|
-
infer(data: any): Promise<Map<string, number>>;
|
|
34
|
-
saveModel(): void;
|
|
35
|
-
running(): boolean;
|
|
36
|
-
ready(): boolean;
|
|
37
|
-
private _preprocessedTargetData;
|
|
38
|
-
private _preprocessedInputData;
|
|
39
|
-
private _preprocessData;
|
|
40
|
-
private _createModel;
|
|
41
|
-
}
|
|
42
|
-
export default LearningMobilenetImage;
|
/package/{src → lib}/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|