Skip to content

Commit

Permalink
feature/255_turning_annotations_on_and_off (#258)
Browse files Browse the repository at this point in the history
* 1.8.0-alpha relese (#197)

* 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

* 1.6.0-alpha relese merge (#94)

* README.md update (#78)

* 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]>

* 1.6.0-alpha relese merge (#93)

* 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]>

Co-authored-by: Fatih Baltacı <[email protected]>
Co-authored-by: PLE12366003 <[email protected]>

* Update README.md

* Update README.md

* Update README.md

* Add files via upload

* Update README.md

* Update README.md

* Update README.md

* MS-86 Coco format suppport (#107)

* up

* save refactor

* coco exporter in progress

* coco exporter in progress

* Disable browser back buttons during labelling (#106)

* done

* up

* Piotr | MS-96 | Can image suppored by multi labels (#109)

* initial refactor

* refactor in progress

* update

* csv export working

* export tags as json

Co-authored-by: PLE12366003 <[email protected]>

* Update README.md

* Piotr | MS-XXX | Import coco labels from file (#111)

* initial refactor

* initial changes

* export popup refactored

* refactor continues

* style changes

* base import popup added

* new feature placeholder added

* hide import button

* up

* drop zone in place

* up

* bug fixing cleanup

* loading mechanism prepared

* update

* more tests and more refactor

* base import created

* almost done

* basic error handling

* done

* done

* Update README.md

* Update README.md

* quick fix

* Update README.md

* Piotr | MS-XXX | Import labels yolo format (#114)

* initial refactor

* popup prepared for other file formats

* fix

* fix

* loading of yolo files in place

* bug fix

* loading labels from file

* up

* up

* refactor

* tests refactor

* filtering file data

* filterFilesData tests added

* up

* up

* done

* working code

* up

* after PR, part 1

* YOLOImporter refactor done

* YOLOImporter refactor done

* Piotr | MS-XXX | Drop down menu (#117)

* initial work on dropdown

* style and base actions

* up

* up

* up

* up

* almost done

* after PR

* update dependencies fixing vulnerabilities (#119)

* Resolves issue #44 (#120)

* Resolves issue #44

* Abstracts handleKeyUp function in TextInput

* Rename props to onKeyUp

* Update README.md

* up

* 1.7.0-alpha relese (#122) (#123)

* 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

* 1.6.0-alpha relese merge (#94)

* README.md update (#78)

* 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]>

* 1.6.0-alpha relese merge (#93)

* 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]>

Co-authored-by: Fatih Baltacı <[email protected]>
Co-authored-by: PLE12366003 <[email protected]>

* Update README.md

* Update README.md

* Update README.md

* Add files via upload

* Update README.md

* Update README.md

* Update README.md

* MS-86 Coco format suppport (#107)

* up

* save refactor

* coco exporter in progress

* coco exporter in progress

* Disable browser back buttons during labelling (#106)

* done

* up

* Piotr | MS-96 | Can image suppored by multi labels (#109)

* initial refactor

* refactor in progress

* update

* csv export working

* export tags as json

Co-authored-by: PLE12366003 <[email protected]>

* Update README.md

* Piotr | MS-XXX | Import coco labels from file (#111)

* initial refactor

* initial changes

* export popup refactored

* refactor continues

* style changes

* base import popup added

* new feature placeholder added

* hide import button

* up

* drop zone in place

* up

* bug fixing cleanup

* loading mechanism prepared

* update

* more tests and more refactor

* base import created

* almost done

* basic error handling

* done

* done

* Update README.md

* Update README.md

* quick fix

* Update README.md

* Piotr | MS-XXX | Import labels yolo format (#114)

* initial refactor

* popup prepared for other file formats

* fix

* fix

* loading of yolo files in place

* bug fix

* loading labels from file

* up

* up

* refactor

* tests refactor

* filtering file data

* filterFilesData tests added

* up

* up

* done

* working code

* up

* after PR, part 1

* YOLOImporter refactor done

* YOLOImporter refactor done

* Piotr | MS-XXX | Drop down menu (#117)

* initial work on dropdown

* style and base actions

* up

* up

* up

* up

* almost done

* after PR

* update dependencies fixing vulnerabilities (#119)

* Resolves issue #44 (#120)

* Resolves issue #44

* Abstracts handleKeyUp function in TextInput

* Rename props to onKeyUp

* Update README.md

* up

Co-authored-by: PLE12366003 <[email protected]>
Co-authored-by: Fatih Baltacı <[email protected]>
Co-authored-by: Augusto L C Schnorr <[email protected]>

Co-authored-by: PLE12366003 <[email protected]>
Co-authored-by: Fatih Baltacı <[email protected]>
Co-authored-by: Augusto L C Schnorr <[email protected]>

* Implement hot keys (#134)

* Added hotkeys for first 10 labels

* updated readme

Co-authored-by: Jordan Wagner <[email protected]>

* Change Manifest.json to reflect MakeSense Name (#145)

* Change Manifest.json to reflect MakeSense Name

* Update manifest.json

* Update README.md

* Update README.md

* Fix importing images and labels with filenames with multiple dots (#160)

* fix importing images and labels with filenames with multiple dots

* fix typo (all test passing)

* removed comments from FileUtils

* added unit tests for filenames with multiple dots

* fix develop build (#162)

* test .nvmrc

* test .node js 11

* small fixes

* feature/msb-001-add_automatic_response_to_new_issues_using_github_actions (#173)

* Bump path-parse from 1.0.6 to 1.0.7 (#170)

Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feature/msb-001-add_automatic_response_to_new_issues_using_github_actions_2 (#182)

* feature/msb-002-add_code-cov_integration (#184)

* feature/msb-002-add_code-cov_integration

* upload test results to code-cov

* add code-cov badge to README.md

* feature/151_add_description_about_each_file_type (#185)

* feature/151_add_description_about_each_file_type

* gh action update

* update documentation structure

* initial documentation

* initial documentation 2

* initial documentation 3

* initial documentation 4

* initial documentation 5

* initial documentation 6

* initial documentation 7

* initial documentation 8

* initial documentation 9

* initial documentation 10

* initial documentation 11

* initial documentation 12

* initial documentation 13

* feature/issue-171_invalid_YOLO_annotations_exported_for_bboxes_on_the… (#188)

* feature/issue-171_invalid_YOLO_annotations_exported_for_bboxes_on_the_edge_of_an_image

* done

* feature/msb-003-bump_make-sense_dependencies (#189)

* feature/msb-003-bump_make-sense_dependencies

* package-lock.json

* Bump url-parse from 1.4.7 to 1.5.3 (#179)

Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.3.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](unshiftio/url-parse@1.4.7...1.5.3)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump dns-packet from 1.3.1 to 1.3.4 (#178)

Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](mafintosh/dns-packet@v1.3.1...v1.3.4)

---
updated-dependencies:
- dependency-name: dns-packet
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump color-string from 1.5.3 to 1.6.0 (#177)

Bumps [color-string](https://github.com/Qix-/color-string) from 1.5.3 to 1.6.0.
- [Release notes](https://github.com/Qix-/color-string/releases)
- [Changelog](https://github.com/Qix-/color-string/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Qix-/color-string/commits/1.6.0)

---
updated-dependencies:
- dependency-name: color-string
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix/dockerfile can be built with current develop branch (#191)

* Update README.md

* Update issue-greetings.yml

* Update mkdocs.yml

* Update README.md

* Update README.md

* initial integration with GTM (#192)

* feature/141_per-class_coloration (#190)

* initial commit - refactor + color palette list + color added to LabelName type + color initiation

* use material ui text field

* label creation and edit is working

* refresh button is working

* color labels work in progress

* render settings refactor

* render rect works

* done

* feature/msb-004_orchestrated_error_reporting_system (#193)

* initial commit - refactor + color palette list + color added to LabelName type + color initiation

* use material ui text field

* label creation and edit is working

* refresh button is working

* color labels work in progress

* render settings refactor

* render rect works

* done

* initial commit with Redux store setup

* initial notifications view plugin

* notifications view is ready to use

* refactor

* refactor 2

* Update README.md

* Update README.md

* feature/167_click_outside_the_image_line (#194)

* feature/164_respect_directory_structure_or_at_least_provide_warning (#195)

* initial refactor

* empty labels validation

* non unique labels validation

* issue/87_tooltips_for_action_bar_buttons (#196)

* tf.js models fix

Co-authored-by: Piotr Skalski <[email protected]>
Co-authored-by: PLE12366003 <[email protected]>
Co-authored-by: Fatih Baltacı <[email protected]>
Co-authored-by: Augusto L C Schnorr <[email protected]>
Co-authored-by: jaaywags <[email protected]>
Co-authored-by: Jordan Wagner <[email protected]>
Co-authored-by: Muhammad Fahmi Rasyid <[email protected]>
Co-authored-by: Héctor A <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Bensoussan <[email protected]>

* initial commit

* more tests

* initial commit

* more tests

* before toggle rect visibility tests

* update react version

* ready for review

Co-authored-by: Piotr Skalski <[email protected]>
Co-authored-by: PLE12366003 <[email protected]>
Co-authored-by: Fatih Baltacı <[email protected]>
Co-authored-by: Augusto L C Schnorr <[email protected]>
Co-authored-by: jaaywags <[email protected]>
Co-authored-by: Jordan Wagner <[email protected]>
Co-authored-by: Muhammad Fahmi Rasyid <[email protected]>
Co-authored-by: Héctor A <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Bensoussan <[email protected]>
  • Loading branch information
11 people authored Jul 19, 2022
1 parent 81f6171 commit a9857e5
Show file tree
Hide file tree
Showing 25 changed files with 489 additions and 279 deletions.
28 changes: 12 additions & 16 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"lodash": "^4.17.21",
"mobile-detect": "^1.4.5",
"moment": "^2.29.3",
"react": "^16.8.6",
"react": "^18.2.0",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "^17.0.2",
"react-dom": "^18.2.0",
"react-dropzone": "^11.3.4",
"react-redux": "^7.2.4",
"react-scripts": "^4.0.3",
Expand Down
Binary file added public/ico/eye.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ico/hide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/interfaces/IRect.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface IRect {
x:number,
y:number,
height:number,
width:number
}
x: number,
y: number,
height: number,
width: number
}
12 changes: 12 additions & 0 deletions src/logic/__tests__/export/RectLabelExport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ describe('RectLabelsExporter wrapRectLabelIntoYOLO method', () => {
width: 90,
height: 82
},
isVisible: true,
isCreatedByAI: false,
status: LabelStatus.ACCEPTED,
suggestedLabel: 'label-000'
}

// when
const result = RectLabelsExporter.wrapRectLabelIntoYOLO(labelRect, labelNames, imageSize)

// then
const [
resultClassIdx,
Expand All @@ -75,12 +78,15 @@ describe('RectLabelsExporter wrapRectLabelIntoYOLO method', () => {
width: 92,
height: 104
},
isVisible: true,
isCreatedByAI: false,
status: LabelStatus.ACCEPTED,
suggestedLabel: 'label-000'
}

// when
const result = RectLabelsExporter.wrapRectLabelIntoYOLO(labelRect, labelNames, imageSize)

// then
const [
resultClassIdx,
Expand All @@ -107,12 +113,15 @@ describe('RectLabelsExporter wrapRectLabelIntoYOLO method', () => {
width: 80,
height: 70
},
isVisible: true,
isCreatedByAI: false,
status: LabelStatus.ACCEPTED,
suggestedLabel: 'label-000'
}

// when
const result = RectLabelsExporter.wrapRectLabelIntoYOLO(labelRect, labelNames, imageSize)

// then
const [
resultClassIdx,
Expand Down Expand Up @@ -141,12 +150,15 @@ describe('RectLabelsExporter wrapRectLabelIntoCSV method', () => {
width: 90,
height: 82
},
isVisible: true,
isCreatedByAI: false,
status: LabelStatus.ACCEPTED,
suggestedLabel: 'label-000'
}

// when
const result = RectLabelsExporter.wrapRectLabelIntoCSV(labelRect, labelNames, imageSize, imageName)

// then
const [
resultClassIdx,
Expand Down
72 changes: 38 additions & 34 deletions src/logic/__tests__/export/polygon/VGGExporter.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {IPoint} from "../../../../interfaces/IPoint";
import {VGGPolygon, VGGRegionsData} from "../../../../data/labels/VGG";
import {ImageData, LabelName} from "../../../../store/labels/types";
import {VGGExporter} from "../../../export/polygon/VGGExporter";
import {IPoint} from '../../../../interfaces/IPoint';
import {VGGPolygon, VGGRegionsData} from '../../../../data/labels/VGG';
import {ImageData, LabelName} from '../../../../store/labels/types';
import {VGGExporter} from '../../../export/polygon/VGGExporter';

describe('VGGExporter mapPolygonToVGG method', () => {
it('should return correct VGGPolygon object', () => {
Expand All @@ -13,7 +13,7 @@ describe('VGGExporter mapPolygonToVGG method', () => {
];

const expectedPolygon: VGGPolygon = {
name: "polygon",
name: 'polygon',
all_points_x: [1, 5, 6, 0, 1],
all_points_y: [1, 1, 10, 10, 1]
};
Expand All @@ -26,10 +26,10 @@ describe('VGGExporter mapPolygonToVGG method', () => {
});
});

describe("VGGExporter mapImageDataToVGG method", () => {
describe('VGGExporter mapImageDataToVGG method', () => {
it('should return null', () => {
const givenImageData: ImageData = {
id: "1",
id: '1',
loadStatus: false,
labelPoints: [],
labelRects: [],
Expand All @@ -45,14 +45,15 @@ describe("VGGExporter mapImageDataToVGG method", () => {

it('should return valid VGGRegionsData', () => {
const givenImageData: ImageData = {
id: "1",
id: '1',
loadStatus: true,
labelPoints: [],
labelRects: [],
labelPolygons: [
{
id: "1",
labelId: "label_1",
id: '1',
labelId: 'label_1',
isVisible: true,
vertices: [
{x: 1, y: 1},
{x: 5, y: 1},
Expand All @@ -61,8 +62,9 @@ describe("VGGExporter mapImageDataToVGG method", () => {
]
},
{
id: "2",
labelId: "label_2",
id: '2',
labelId: 'label_2',
isVisible: true,
vertices: [
{x: 1, y: 1},
{x: 5, y: 1},
Expand All @@ -81,34 +83,34 @@ describe("VGGExporter mapImageDataToVGG method", () => {

const givenLabelNames: LabelName[] = [
{
id: "label_1",
name: "banana"
id: 'label_1',
name: 'banana'
},
{
id: "label_2",
name: "kiwi"
id: 'label_2',
name: 'kiwi'
}
];

const expectedVGGRegionData: VGGRegionsData = {
"0": {
'0': {
shape_attributes: {
name: "polygon",
name: 'polygon',
all_points_x: [1, 5, 6, 0, 1],
all_points_y: [1, 1, 10, 10, 1]
},
region_attributes: {
label: "banana"
label: 'banana'
}
},
"1": {
'1': {
shape_attributes: {
name: "polygon",
name: 'polygon',
all_points_x: [1, 5, 6, 10, 0, 1],
all_points_y: [1, 1, 10, 10, 10, 1]
},
region_attributes: {
label: "kiwi"
label: 'kiwi'
}
}
};
Expand All @@ -117,14 +119,15 @@ describe("VGGExporter mapImageDataToVGG method", () => {

it('should return valid VGGRegionsData', () => {
const givenImageData: ImageData = {
id: "1",
id: '1',
loadStatus: true,
labelPoints: [],
labelRects: [],
labelPolygons: [
{
id: "1",
labelId: "label_1",
id: '1',
labelId: 'label_1',
isVisible: true,
vertices: [
{x: 1, y: 1},
{x: 5, y: 1},
Expand All @@ -133,8 +136,9 @@ describe("VGGExporter mapImageDataToVGG method", () => {
]
},
{
id: "2",
id: '2',
labelId: null,
isVisible: true,
vertices: [
{x: 1, y: 1},
{x: 5, y: 1},
Expand All @@ -153,27 +157,27 @@ describe("VGGExporter mapImageDataToVGG method", () => {

const givenLabelNames: LabelName[] = [
{
id: "label_1",
name: "banana"
id: 'label_1',
name: 'banana'
},
{
id: "label_2",
name: "kiwi"
id: 'label_2',
name: 'kiwi'
}
];

const expectedVGGRegionData: VGGRegionsData = {
"0": {
'0': {
shape_attributes: {
name: "polygon",
name: 'polygon',
all_points_x: [1, 5, 6, 0, 1],
all_points_y: [1, 1, 10, 10, 1]
},
region_attributes: {
label: "banana"
label: 'banana'
}
}
};
expect(VGGExporter.mapImageDataToVGG(givenImageData, givenLabelNames)).toEqual(expectedVGGRegionData);
});
});
});
10 changes: 5 additions & 5 deletions src/logic/actions/AIActions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {LabelType} from "../../data/enums/LabelType";
import {LabelsSelector} from "../../store/selectors/LabelsSelector";
import {AIObjectDetectionActions} from "./AIObjectDetectionActions";
import {AIPoseDetectionActions} from "./AIPoseDetectionActions";
import {ImageData} from "../../store/labels/types";
import {LabelType} from '../../data/enums/LabelType';
import {LabelsSelector} from '../../store/selectors/LabelsSelector';
import {AIObjectDetectionActions} from './AIObjectDetectionActions';
import {AIPoseDetectionActions} from './AIPoseDetectionActions';
import {ImageData} from '../../store/labels/types';

export class AIActions {
public static excludeRejectedLabelNames(suggestedLabels: string[], rejectedLabels: string[]): string[] {
Expand Down
1 change: 1 addition & 0 deletions src/logic/actions/AIObjectDetectionActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class AIObjectDetectionActions {
width: prediction.bbox[2],
height: prediction.bbox[3],
},
isVisible: true,
isCreatedByAI: true,
status: LabelStatus.UNDECIDED,
suggestedLabel: prediction.class
Expand Down
1 change: 1 addition & 0 deletions src/logic/actions/AIPoseDetectionActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class AIPoseDetectionActions {
x: keypoint.position.x,
y: keypoint.position.y
},
isVisible: true,
isCreatedByAI: true,
status: LabelStatus.UNDECIDED,
suggestedLabel: keypoint.part
Expand Down
21 changes: 21 additions & 0 deletions src/logic/actions/LabelActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {filter} from 'lodash';
import {store} from '../../index';
import {updateImageData, updateImageDataById} from '../../store/labels/actionCreators';
import {LabelType} from '../../data/enums/LabelType';
import {LabelUtil} from '../../utils/LabelUtil';

export class LabelActions {
public static deleteActiveLabel() {
Expand Down Expand Up @@ -70,6 +71,26 @@ export class LabelActions {
store.dispatch(updateImageDataById(imageData.id, newImageData));
}

public static toggleLabelVisibilityById(imageId: string, labelId: string) {
const imageData: ImageData = LabelsSelector.getImageDataById(imageId);
const newImageData = {
...imageData,
labelPoints: imageData.labelPoints.map((labelPoint: LabelPoint) => {
return labelPoint.id === labelId ? LabelUtil.toggleAnnotationVisibility(labelPoint) : labelPoint
}),
labelRects: imageData.labelRects.map((labelRect: LabelRect) => {
return labelRect.id === labelId ? LabelUtil.toggleAnnotationVisibility(labelRect) : labelRect
}),
labelPolygons: imageData.labelPolygons.map((labelPolygon: LabelPolygon) => {
return labelPolygon.id === labelId ? LabelUtil.toggleAnnotationVisibility(labelPolygon) : labelPolygon
}),
labelLines: imageData.labelLines.map((labelLine: LabelLine) => {
return labelLine.id === labelId ? LabelUtil.toggleAnnotationVisibility(labelLine) : labelLine
}),
};
store.dispatch(updateImageDataById(imageData.id, newImageData));
}

public static removeLabelNames(labelNamesIds: string[]) {
const imagesData: ImageData[] = LabelsSelector.getImagesData();
const newImagesData: ImageData[] = imagesData.map((imageData: ImageData) => {
Expand Down
Loading

0 comments on commit a9857e5

Please sign in to comment.