-
-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Merge pull request #70 from SkalskiP/develop (#71) * new gif with ssd and posenet * Add Docker Support (#74) * add Dockerfile for make-sense * Update README for Docker * README updated * README updated with docker logs * readme updated * Update Dockerfile * Update README.md * basic stats * README.md update (#78) (#79) * Merge pull request #70 from SkalskiP/develop (#71) * new gif with ssd and posenet * Add Docker Support (#74) * add Dockerfile for make-sense * Update README for Docker * README updated * README updated with docker logs * readme updated * Update Dockerfile * Update README.md * basic stats Co-authored-by: Fatih Baltacı <[email protected]> Co-authored-by: Fatih Baltacı <[email protected]> * add cross hair (#90) * Piotr | Line labels creation and export (#89) * initial changes: adding line labels to redux + addling line tab to right side navigation bar * adding new lines and base rendering * up * line style + snapping to rect added * highlight logic added * line rendering engine is working * line rendering engine update + marking line labeled images added * serializing to CSV * up * after PR * after PR * quick fix * Piotr | Image recognition (#92) * image recognition initial commit * setup before image recognition tagging * base tag assignment added * default screen when empty label list * image recognition added * after CR Co-authored-by: PLE12366003 <[email protected]> Co-authored-by: Fatih Baltacı <[email protected]>
- Loading branch information
1 parent
0d3cbb1
commit 16b06c8
Showing
52 changed files
with
1,186 additions
and
88 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,4 @@ | ||
export enum LineAnchorType { | ||
START = "START", | ||
END = "END" | ||
} |
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,9 @@ | ||
import {IExportFormat} from "../../interfaces/IExportFormat"; | ||
import {ExportFormatType} from "../enums/ExportFormatType"; | ||
|
||
export const LineExportFormatData: IExportFormat[] = [ | ||
{ | ||
type: ExportFormatType.CSV, | ||
label: "Single CSV 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {IExportFormat} from "../../interfaces/IExportFormat"; | ||
import {ExportFormatType} from "../enums/ExportFormatType"; | ||
|
||
export const TagExportFormatData: IExportFormat[] = [ | ||
{ | ||
type: ExportFormatType.CSV, | ||
label: "Single CSV 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
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,59 @@ | ||
import {ExportFormatType} from "../../data/enums/ExportFormatType"; | ||
import {LabelsSelector} from "../../store/selectors/LabelsSelector"; | ||
import {ImageData, LabelLine, LabelName} from "../../store/labels/types"; | ||
import {saveAs} from "file-saver"; | ||
import {ExporterUtil} from "../../utils/ExporterUtil"; | ||
import {ImageRepository} from "../imageRepository/ImageRepository"; | ||
import {findLast} from "lodash"; | ||
|
||
export class LineLabelsExporter { | ||
public static export(exportFormatType: ExportFormatType): void { | ||
switch (exportFormatType) { | ||
case ExportFormatType.CSV: | ||
LineLabelsExporter.exportAsCSV(); | ||
break; | ||
default: | ||
return; | ||
} | ||
} | ||
|
||
private static exportAsCSV(): void { | ||
const content: string = LabelsSelector.getImagesData() | ||
.map((imageData: ImageData) => { | ||
return LineLabelsExporter.wrapLineLabelsIntoCSV(imageData)}) | ||
.filter((imageLabelData: string) => { | ||
return !!imageLabelData}) | ||
.join("\n"); | ||
|
||
const blob = new Blob([content], {type: "text/plain;charset=utf-8"}); | ||
try { | ||
saveAs(blob, `${ExporterUtil.getExportFileName()}.csv`); | ||
} catch (error) { | ||
// TODO | ||
throw new Error(error); | ||
} | ||
} | ||
|
||
private static wrapLineLabelsIntoCSV(imageData: ImageData): string { | ||
if (imageData.labelLines.length === 0 || !imageData.loadStatus) | ||
return null; | ||
|
||
const image: HTMLImageElement = ImageRepository.getById(imageData.id); | ||
const labelNames: LabelName[] = LabelsSelector.getLabelNames(); | ||
const labelLinesString: string[] = imageData.labelLines.map((labelLine: LabelLine) => { | ||
const labelName: LabelName = findLast(labelNames, {id: labelLine.labelId}); | ||
const labelFields = !!labelName ? [ | ||
labelName.name, | ||
Math.round(labelLine.line.start.x).toString(), | ||
Math.round(labelLine.line.start.y).toString(), | ||
Math.round(labelLine.line.end.x).toString(), | ||
Math.round(labelLine.line.end.y).toString(), | ||
imageData.fileData.name, | ||
image.width.toString(), | ||
image.height.toString() | ||
] : []; | ||
return labelFields.join(",") | ||
}); | ||
return labelLinesString.join("\n"); | ||
} | ||
} |
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,53 @@ | ||
import {ExportFormatType} from "../../data/enums/ExportFormatType"; | ||
import {LabelsSelector} from "../../store/selectors/LabelsSelector"; | ||
import {ImageData, LabelName} from "../../store/labels/types"; | ||
import {saveAs} from "file-saver"; | ||
import {ExporterUtil} from "../../utils/ExporterUtil"; | ||
import {ImageRepository} from "../imageRepository/ImageRepository"; | ||
import {findLast} from "lodash"; | ||
|
||
export class TagLabelsExporter { | ||
public static export(exportFormatType: ExportFormatType): void { | ||
switch (exportFormatType) { | ||
case ExportFormatType.CSV: | ||
TagLabelsExporter.exportAsCSV(); | ||
break; | ||
default: | ||
return; | ||
} | ||
} | ||
|
||
private static exportAsCSV(): void { | ||
const content: string = LabelsSelector.getImagesData() | ||
.map((imageData: ImageData) => { | ||
return TagLabelsExporter.wrapLineLabelsIntoCSV(imageData)}) | ||
.filter((imageLabelData: string) => { | ||
return !!imageLabelData}) | ||
.join("\n"); | ||
|
||
const blob = new Blob([content], {type: "text/plain;charset=utf-8"}); | ||
try { | ||
saveAs(blob, `${ExporterUtil.getExportFileName()}.csv`); | ||
} catch (error) { | ||
// TODO | ||
throw new Error(error); | ||
} | ||
} | ||
|
||
private static wrapLineLabelsIntoCSV(imageData: ImageData): string { | ||
if (imageData.labelTagId === null || !imageData.loadStatus) | ||
return null; | ||
|
||
const image: HTMLImageElement = ImageRepository.getById(imageData.id); | ||
const labelNames: LabelName[] = LabelsSelector.getLabelNames(); | ||
const labelName: LabelName = findLast(labelNames, {id: imageData.labelTagId}); | ||
const labelFields = !!labelName ? [ | ||
labelName.name, | ||
imageData.fileData.name, | ||
image.width.toString(), | ||
image.height.toString() | ||
] : []; | ||
return labelFields.join(",") | ||
|
||
} | ||
} |
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
Oops, something went wrong.