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

fix: CNTK export images bug fix #789

Merged
merged 1 commit into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HtmlFileReader updates the incoming asset and appends a .jpg to the name. Not the best practice but it's consistent with the other exporters.

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();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handles case where user was using older -preview versions.


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