-
-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/msb-004_orchestrated_error_reporting_system (#193)
* initial commit - refactor + color palette list + color added to LabelName type + color initiation * use material ui text field * label creation and edit is working * refresh button is working * color labels work in progress * render settings refactor * render rect works * done * initial commit with Redux store setup * initial notifications view plugin * notifications view is ready to use * refactor * refactor 2
- Loading branch information
Showing
21 changed files
with
583 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,54 @@ | ||
import {ILabelFormatData} from "../interfaces/ILabelFormatData"; | ||
import {LabelType} from "./enums/LabelType"; | ||
import {AnnotationFormatType} from "./enums/AnnotationFormatType"; | ||
import {ILabelFormatData} from '../interfaces/ILabelFormatData'; | ||
import {LabelType} from './enums/LabelType'; | ||
import {AnnotationFormatType} from './enums/AnnotationFormatType'; | ||
|
||
export type ExportFormatDataMap = { [s in LabelType]: ILabelFormatData[]; }; | ||
export type ExportFormatDataMap = Record<LabelType, ILabelFormatData[]>; | ||
|
||
export const ExportFormatData: ExportFormatDataMap = { | ||
"RECT": [ | ||
[LabelType.RECT]: [ | ||
{ | ||
type: AnnotationFormatType.YOLO, | ||
label: "A .zip package containing files in YOLO format." | ||
label: 'A .zip package containing files in YOLO format.' | ||
}, | ||
{ | ||
type: AnnotationFormatType.VOC, | ||
label: "A .zip package containing files in VOC XML format." | ||
label: 'A .zip package containing files in VOC XML format.' | ||
}, | ||
{ | ||
type: AnnotationFormatType.CSV, | ||
label: "Single CSV file." | ||
label: 'Single CSV file.' | ||
} | ||
], | ||
"POINT": [ | ||
[LabelType.POINT]: [ | ||
{ | ||
type: AnnotationFormatType.CSV, | ||
label: "Single CSV file." | ||
label: 'Single CSV file.' | ||
} | ||
], | ||
"LINE": [ | ||
[LabelType.LINE]: [ | ||
{ | ||
type: AnnotationFormatType.CSV, | ||
label: "Single CSV file." | ||
label: 'Single CSV file.' | ||
} | ||
], | ||
"POLYGON": [ | ||
[LabelType.POLYGON]: [ | ||
{ | ||
type: AnnotationFormatType.VGG, | ||
label: "Single file in VGG JSON format." | ||
label: 'Single file in VGG JSON format.' | ||
}, | ||
{ | ||
type: AnnotationFormatType.COCO, | ||
label: "Single file in COCO JSON format." | ||
label: 'Single file in COCO JSON format.' | ||
} | ||
], | ||
"IMAGE RECOGNITION": [ | ||
[LabelType.IMAGE_RECOGNITION]: [ | ||
{ | ||
type: AnnotationFormatType.CSV, | ||
label: "Single CSV file." | ||
label: 'Single CSV file.' | ||
}, | ||
{ | ||
type: AnnotationFormatType.JSON, | ||
label: "Single JSON file." | ||
label: 'Single JSON file.' | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import {AnnotationFormatType} from "./enums/AnnotationFormatType"; | ||
import {AnnotationImporter} from "../logic/import/AnnotationImporter"; | ||
import {COCOImporter} from "../logic/import/coco/COCOImporter"; | ||
import {YOLOImporter} from "../logic/import/yolo/YOLOImporter"; | ||
import {AnnotationFormatType} from './enums/AnnotationFormatType'; | ||
import {AnnotationImporter} from '../logic/import/AnnotationImporter'; | ||
import {COCOImporter} from '../logic/import/coco/COCOImporter'; | ||
import {YOLOImporter} from '../logic/import/yolo/YOLOImporter'; | ||
|
||
export type ImporterSpecDataMap = { [s in AnnotationFormatType]: typeof AnnotationImporter; }; | ||
export type ImporterSpecDataMap = Record<AnnotationFormatType, typeof AnnotationImporter>; | ||
|
||
|
||
export const ImporterSpecData: ImporterSpecDataMap = { | ||
COCO: COCOImporter, | ||
CSV: undefined, | ||
JSON: undefined, | ||
VGG: undefined, | ||
VOC: undefined, | ||
YOLO: YOLOImporter | ||
} | ||
[AnnotationFormatType.COCO]: COCOImporter, | ||
[AnnotationFormatType.CSV]: undefined, | ||
[AnnotationFormatType.JSON]: undefined, | ||
[AnnotationFormatType.VGG]: undefined, | ||
[AnnotationFormatType.VOC]: undefined, | ||
[AnnotationFormatType.YOLO]: YOLOImporter | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
export enum AnnotationFormatType { | ||
YOLO = "YOLO", | ||
COCO = "COCO", | ||
CSV = "CSV", | ||
JSON = "JSON", | ||
VOC = "VOC", | ||
VGG = "VGG" | ||
YOLO = 'YOLO', | ||
COCO = 'COCO', | ||
CSV = 'CSV', | ||
JSON = 'JSON', | ||
VOC = 'VOC', | ||
VGG = 'VGG' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export enum NotificationType { | ||
ERROR = 'ERROR', | ||
SUCCESS = 'SUCCESS', | ||
MESSAGE = 'MESSAGE' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {INotification, NotificationsActionType} from './types'; | ||
import {Action} from '../Actions'; | ||
|
||
export function submitNewNotification(notification: INotification): NotificationsActionType { | ||
return { | ||
type: Action.SUBMIT_NEW_NOTIFICATION, | ||
payload: { | ||
notification, | ||
}, | ||
}; | ||
} | ||
|
||
|
||
export function deleteNotificationById(id: string): NotificationsActionType { | ||
return { | ||
type: Action.DELETE_NOTIFICATION_BY_ID, | ||
payload: { | ||
id, | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {INotification, NotificationsActionType, NotificationsState} from './types'; | ||
import {Action} from '../Actions'; | ||
|
||
const initialState: NotificationsState = { | ||
queue: [] | ||
} | ||
|
||
export function notificationsReducer( | ||
state = initialState, | ||
action: NotificationsActionType | ||
): NotificationsState { | ||
switch (action.type) { | ||
case Action.SUBMIT_NEW_NOTIFICATION: { | ||
return { | ||
...state, | ||
queue: [...state.queue, action.payload.notification] | ||
} | ||
} | ||
case Action.DELETE_NOTIFICATION_BY_ID: { | ||
return { | ||
...state, | ||
queue: state.queue | ||
.filter((message: INotification) => message.id !== action.payload.id) | ||
} | ||
} | ||
default: | ||
return state; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {NotificationType} from '../../data/enums/NotificationType'; | ||
import {Action} from '../Actions'; | ||
|
||
export interface INotification { | ||
id: string, | ||
type: NotificationType, | ||
header: string, | ||
description: string | ||
} | ||
|
||
export type NotificationsState = { | ||
queue: INotification[] | ||
} | ||
|
||
interface SubmitNewNotification { | ||
type: typeof Action.SUBMIT_NEW_NOTIFICATION; | ||
payload: { | ||
notification: INotification; | ||
} | ||
} | ||
|
||
interface DeleteNotificationById { | ||
type: typeof Action.DELETE_NOTIFICATION_BY_ID; | ||
payload: { | ||
id: string; | ||
} | ||
} | ||
|
||
export type NotificationsActionType = SubmitNewNotification | DeleteNotificationById |
Oops, something went wrong.