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

Commit

Permalink
fix: Updates backwards compat & fixes cntk export image bug (#789)
Browse files Browse the repository at this point in the history
Fixes an issue where the images exported out of a video file were missing file extension for video projects.
  • Loading branch information
wbreza committed Apr 29, 2019
1 parent 4d02db4 commit 2234c8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/providers/export/cntk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,12 @@ export class CntkExportProvider extends ExportProvider<ICntkExportProviderOption
});
});

const buffer = await HtmlFileReader.getAssetArray(assetMetadata.asset);
const folderName = exportSplit === ExportSplit.Train ? "positive" : "testImages";
const labelsPath = `${this.exportFolderName}/${folderName}/${assetMetadata.asset.name}.bboxes.labels.tsv`;
const boundingBoxPath = `${this.exportFolderName}/${folderName}/${assetMetadata.asset.name}.bboxes.tsv`;
const binaryPath = `${this.exportFolderName}/${folderName}/${assetMetadata.asset.name}`;

const buffer = await HtmlFileReader.getAssetArray(assetMetadata.asset);

await Promise.all([
this.storageProvider.writeText(labelsPath, labelData.join(os.EOL)),
this.storageProvider.writeText(boundingBoxPath, boundingBoxData.join(os.EOL)),
Expand Down
4 changes: 3 additions & 1 deletion src/services/projectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ export default class ProjectService implements IProjectService {
* @param project The project to update
*/
private ensureBackwardsCompatibility(project: IProject) {
if (project.version === "2.0.0") {
const projectVersion = project.version.toLowerCase();

if (projectVersion.startsWith("2.0.0")) {
// Required for backwards compatibility with v2.0.0 release
if (project.exportFormat.providerType === "tensorFlowPascalVOC") {
project.exportFormat.providerType = "pascalVOC";
Expand Down

0 comments on commit 2234c8a

Please sign in to comment.