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

Commit

Permalink
feat: Add CSV Exporter (#757)
Browse files Browse the repository at this point in the history
Adds CSV export provider
  • Loading branch information
JacopoMangiavacchi authored and wbreza committed Apr 26, 2019
1 parent ee6cc77 commit bae8338
Show file tree
Hide file tree
Showing 14 changed files with 334 additions and 33 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ Tagging and drawing regions is not possible while the video is playing.
Once assets have been labeled, they can be exported into a variety of formats:

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

In addition, users may choose to export

Expand Down
33 changes: 32 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"dotenv": "^7.0.0",
"google-protobuf": "^3.6.1",
"jpeg-js": "^0.3.4",
"json2csv": "^4.5.0",
"lodash": "^4.17.11",
"md5.js": "^1.3.5",
"node-fetch": "^2.3.0",
Expand Down Expand Up @@ -98,6 +99,7 @@
"@types/dotenv": "^6.1.0",
"@types/enzyme": "^3.1.15",
"@types/jest": "23.3.9",
"@types/json2csv": "^4.4.0",
"@types/node": "10.12.7",
"@types/react": "16.7.6",
"@types/react-dom": "16.0.9",
Expand Down
11 changes: 6 additions & 5 deletions src/common/localization/en-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,17 +302,15 @@ export const english: IAppStrings = {
title: "Test / Train Split",
description: "The test train split to use for exported data",
},
},
},
vottJson: {
displayName: "VoTT JSON",
properties: {
includeImages: {
title: "Include Images",
description: "Whether or not to include binary image assets in target connection",
},
},
},
vottJson: {
displayName: "VoTT JSON",
},
azureCV: {
displayName: "Azure Custom Vision Service",
regions: {
Expand Down Expand Up @@ -385,6 +383,9 @@ export const english: IAppStrings = {
cntk: {
displayName: "Microsoft Cognitive Toolkit (CNTK)",
},
csv: {
displayName: "Comma Separated Values (CSV)",
},
},
messages: {
saveSuccess: "Successfully saved export settings",
Expand Down
11 changes: 6 additions & 5 deletions src/common/localization/es-cl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,17 +305,15 @@ export const spanish: IAppStrings = {
title: "La división para entrenar y comprobar",
description: "La división de datos para utilizar entre el entrenamiento y la comprobación",
},
},
},
vottJson: {
displayName: "VoTT JSON",
properties: {
includeImages: {
title: "Incluir imágenes",
description: "Si desea o no incluir activos de imagen binaria en la conexión de destino",
},
},
},
vottJson: {
displayName: "VoTT JSON",
},
azureCV: {
displayName: "Servicio de Visión Personalizada Azure",
regions: {
Expand Down Expand Up @@ -388,6 +386,9 @@ export const spanish: IAppStrings = {
cntk: {
displayName: "Microsoft Cognitive Toolkit (CNTK)",
},
csv: {
displayName: "Los valores separados por comas (CSV)",
},
},
messages: {
saveSuccess: "Configuración de exportación guardada correctamente",
Expand Down
4 changes: 2 additions & 2 deletions src/common/mockFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,14 +638,14 @@ export default class MockFactory {

/**
* Creates array of IExportProviderRegistrationOptions for the different providers
* vottJson, pascalVOC, azureCustomVision
* vottJson, PascalVOC, azureCustomVision, csv
*/
public static createExportProviderRegistrations(): IExportProviderRegistrationOptions[] {
const registrations: IExportProviderRegistrationOptions[] = [];
registrations.push(MockFactory.createExportProviderRegistration("vottJson"));
registrations.push(MockFactory.createExportProviderRegistration("pascalVOC"));
registrations.push(MockFactory.createExportProviderRegistration("azureCustomVision"));

registrations.push(MockFactory.createExportProviderRegistration("csv"));
return registrations;
}

Expand Down
11 changes: 6 additions & 5 deletions src/common/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,15 @@ export interface IAppStrings {
title: string,
description: string,
},
},
},
vottJson: {
displayName: string,
properties: {
includeImages: {
title: string,
description: string,
},
},
},
vottJson: {
displayName: string,
},
azureCV: {
displayName: string,
regions: {
Expand Down Expand Up @@ -382,6 +380,9 @@ export interface IAppStrings {
cntk: {
displayName: string,
},
csv: {
displayName: string,
},
},
messages: {
saveSuccess: string;
Expand Down
28 changes: 28 additions & 0 deletions src/providers/export/csv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"type": "object",
"title": "${strings.export.providers.csv.displayName}",
"properties": {
"assetState": {
"type": "string",
"title": "${strings.export.providers.common.properties.assetState.title}",
"description": "${strings.export.providers.common.properties.assetState.description}",
"enum": [
"all",
"visited",
"tagged"
],
"default": "visited",
"enumNames": [
"${strings.export.providers.common.properties.assetState.options.all}",
"${strings.export.providers.common.properties.assetState.options.visited}",
"${strings.export.providers.common.properties.assetState.options.tagged}"
]
},
"includeImages": {
"type": "boolean",
"default": true,
"title": "${strings.export.providers.common.properties.includeImages.title}",
"description": "${strings.export.providers.common.properties.includeImages.description}"
}
}
}
Loading

0 comments on commit bae8338

Please sign in to comment.