Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

Commit bae8338

Browse files
JacopoMangiavacchiwbreza
authored andcommitted
feat: Add CSV Exporter (#757)
Adds CSV export provider
1 parent ee6cc77 commit bae8338

File tree

14 files changed

+334
-33
lines changed

14 files changed

+334
-33
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,10 @@ Tagging and drawing regions is not possible while the video is playing.
195195
Once assets have been labeled, they can be exported into a variety of formats:
196196

197197
* [Azure Custom Vision Service](https://azure.microsoft.com/en-us/services/cognitive-services/custom-vision-service/)
198+
* [Microsoft Cognitive Toolkit (CNTK)](https://github.com/Microsoft/CNTK)
198199
* TensorFlow (Pascal VOC and TFRecords)
199200
* VoTT (generic JSON schema)
201+
* Comma Separated Values (CSV)
200202

201203
In addition, users may choose to export
202204

package-lock.json

Lines changed: 32 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"dotenv": "^7.0.0",
2626
"google-protobuf": "^3.6.1",
2727
"jpeg-js": "^0.3.4",
28+
"json2csv": "^4.5.0",
2829
"lodash": "^4.17.11",
2930
"md5.js": "^1.3.5",
3031
"node-fetch": "^2.3.0",
@@ -98,6 +99,7 @@
9899
"@types/dotenv": "^6.1.0",
99100
"@types/enzyme": "^3.1.15",
100101
"@types/jest": "23.3.9",
102+
"@types/json2csv": "^4.4.0",
101103
"@types/node": "10.12.7",
102104
"@types/react": "16.7.6",
103105
"@types/react-dom": "16.0.9",

src/common/localization/en-us.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,15 @@ export const english: IAppStrings = {
302302
title: "Test / Train Split",
303303
description: "The test train split to use for exported data",
304304
},
305-
},
306-
},
307-
vottJson: {
308-
displayName: "VoTT JSON",
309-
properties: {
310305
includeImages: {
311306
title: "Include Images",
312307
description: "Whether or not to include binary image assets in target connection",
313308
},
314309
},
315310
},
311+
vottJson: {
312+
displayName: "VoTT JSON",
313+
},
316314
azureCV: {
317315
displayName: "Azure Custom Vision Service",
318316
regions: {
@@ -385,6 +383,9 @@ export const english: IAppStrings = {
385383
cntk: {
386384
displayName: "Microsoft Cognitive Toolkit (CNTK)",
387385
},
386+
csv: {
387+
displayName: "Comma Separated Values (CSV)",
388+
},
388389
},
389390
messages: {
390391
saveSuccess: "Successfully saved export settings",

src/common/localization/es-cl.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,15 @@ export const spanish: IAppStrings = {
305305
title: "La división para entrenar y comprobar",
306306
description: "La división de datos para utilizar entre el entrenamiento y la comprobación",
307307
},
308-
},
309-
},
310-
vottJson: {
311-
displayName: "VoTT JSON",
312-
properties: {
313308
includeImages: {
314309
title: "Incluir imágenes",
315310
description: "Si desea o no incluir activos de imagen binaria en la conexión de destino",
316311
},
317312
},
318313
},
314+
vottJson: {
315+
displayName: "VoTT JSON",
316+
},
319317
azureCV: {
320318
displayName: "Servicio de Visión Personalizada Azure",
321319
regions: {
@@ -388,6 +386,9 @@ export const spanish: IAppStrings = {
388386
cntk: {
389387
displayName: "Microsoft Cognitive Toolkit (CNTK)",
390388
},
389+
csv: {
390+
displayName: "Los valores separados por comas (CSV)",
391+
},
391392
},
392393
messages: {
393394
saveSuccess: "Configuración de exportación guardada correctamente",

src/common/mockFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,14 +638,14 @@ export default class MockFactory {
638638

639639
/**
640640
* Creates array of IExportProviderRegistrationOptions for the different providers
641-
* vottJson, pascalVOC, azureCustomVision
641+
* vottJson, PascalVOC, azureCustomVision, csv
642642
*/
643643
public static createExportProviderRegistrations(): IExportProviderRegistrationOptions[] {
644644
const registrations: IExportProviderRegistrationOptions[] = [];
645645
registrations.push(MockFactory.createExportProviderRegistration("vottJson"));
646646
registrations.push(MockFactory.createExportProviderRegistration("pascalVOC"));
647647
registrations.push(MockFactory.createExportProviderRegistration("azureCustomVision"));
648-
648+
registrations.push(MockFactory.createExportProviderRegistration("csv"));
649649
return registrations;
650650
}
651651

src/common/strings.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,15 @@ export interface IAppStrings {
299299
title: string,
300300
description: string,
301301
},
302-
},
303-
},
304-
vottJson: {
305-
displayName: string,
306-
properties: {
307302
includeImages: {
308303
title: string,
309304
description: string,
310305
},
311306
},
312307
},
308+
vottJson: {
309+
displayName: string,
310+
},
313311
azureCV: {
314312
displayName: string,
315313
regions: {
@@ -382,6 +380,9 @@ export interface IAppStrings {
382380
cntk: {
383381
displayName: string,
384382
},
383+
csv: {
384+
displayName: string,
385+
},
385386
},
386387
messages: {
387388
saveSuccess: string;

src/providers/export/csv.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"type": "object",
3+
"title": "${strings.export.providers.csv.displayName}",
4+
"properties": {
5+
"assetState": {
6+
"type": "string",
7+
"title": "${strings.export.providers.common.properties.assetState.title}",
8+
"description": "${strings.export.providers.common.properties.assetState.description}",
9+
"enum": [
10+
"all",
11+
"visited",
12+
"tagged"
13+
],
14+
"default": "visited",
15+
"enumNames": [
16+
"${strings.export.providers.common.properties.assetState.options.all}",
17+
"${strings.export.providers.common.properties.assetState.options.visited}",
18+
"${strings.export.providers.common.properties.assetState.options.tagged}"
19+
]
20+
},
21+
"includeImages": {
22+
"type": "boolean",
23+
"default": true,
24+
"title": "${strings.export.providers.common.properties.includeImages.title}",
25+
"description": "${strings.export.providers.common.properties.includeImages.description}"
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)