forked from SkalskiP/make-sense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
YOLOErrors.ts
34 lines (30 loc) · 1.12 KB
/
YOLOErrors.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
export class YOLOAnnotationsLoadingError extends Error {
constructor(message) {
super(message);
this.name = 'YOLOAnnotationsLoadingError';
}
}
export class YOLOLabelsReadingError extends YOLOAnnotationsLoadingError {
constructor() {
super('Unexpected error occurred during reading label names from labels.txt file');
this.name = 'YOLOLabelsLoadingError';
}
}
export class NoLabelNamesFileProvidedError extends YOLOAnnotationsLoadingError {
constructor() {
super('For YOLO labels to be loaded correctly, labels.txt file is required');
this.name = 'NoLabelNamesFileProvidedError';
}
}
export class LabelNamesNotUniqueError extends YOLOAnnotationsLoadingError {
constructor() {
super('Label names listed in labels.txt file should be unique');
this.name = 'LabelNamesNotUniqueError';
}
}
export class AnnotationsParsingError extends YOLOAnnotationsLoadingError {
constructor(imageName: string) {
super(`Unexpected error occurred during parsing of ${imageName} annotations file`);
this.name = 'AnnotationsParsingError';
}
}