@searpent/react-image-annotate 2.0.77 → 2.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Annotator/exampleImages.js +41 -0
- package/Annotator/examplePhotos.js +6980 -0
- package/Annotator/index.js +417 -0
- package/Annotator/reducers/combine-reducers.js +14 -0
- package/Annotator/reducers/convert-expanding-line-to-polygon.js +73 -0
- package/{src/Annotator → Annotator}/reducers/fix-twisted.js +3 -5
- package/Annotator/reducers/general-reducer.js +1430 -0
- package/Annotator/reducers/get-active-image.js +27 -0
- package/Annotator/reducers/get-implied-video-regions.js +180 -0
- package/Annotator/reducers/history-handler.js +38 -0
- package/Annotator/reducers/image-reducer.js +20 -0
- package/Annotator/reducers/video-reducer.js +88 -0
- package/ClassSelectionMenu/index.js +140 -0
- package/Crosshairs/index.js +53 -0
- package/DebugSidebarBox/index.js +20 -0
- package/DemoSite/Editor.js +194 -0
- package/DemoSite/ErrorBoundaryDialog.js +64 -0
- package/DemoSite/index.js +40 -0
- package/Editor/annotation-plugin/annotation.js +697 -0
- package/Editor/index.js +93 -0
- package/Editor/readOnly.js +123 -0
- package/{src/Editor → Editor}/tools.js +2 -3
- package/Errorer/index.js +11 -0
- package/FullImageSegmentationAnnotator/index.js +7 -0
- package/GroupSelectorSidebarBox/index.js +63 -0
- package/GroupsEditorSidebarBox/index.js +138 -0
- package/HelpSidebarBox/index.js +58 -0
- package/HighlightBox/index.js +102 -0
- package/HistorySidebarBox/index.js +71 -0
- package/ImageCanvas/index.js +441 -0
- package/ImageCanvas/region-tools.js +165 -0
- package/{src/ImageCanvas → ImageCanvas}/styles.js +12 -8
- package/ImageCanvas/use-mouse.js +180 -0
- package/ImageCanvas/use-project-box.js +27 -0
- package/ImageCanvas/use-wasd-mode.js +62 -0
- package/ImageMask/index.js +133 -0
- package/ImageMask/load-image.js +25 -0
- package/ImageSelectorSidebarBox/index.js +60 -0
- package/KeyframeTimeline/get-time-string.js +27 -0
- package/KeyframeTimeline/index.js +233 -0
- package/KeyframesSelectorSidebarBox/index.js +93 -0
- package/LandingPage/index.js +159 -0
- package/Locker/index.js +11 -0
- package/MainLayout/RightSidebarItemsWrapper.js +19 -0
- package/MainLayout/icon-dictionary.js +104 -0
- package/MainLayout/index.js +526 -0
- package/{src/MainLayout → MainLayout}/styles.js +6 -7
- package/MainLayout/types.js +0 -0
- package/MainLayout/use-implied-video-regions.js +13 -0
- package/MetadataEditorSidebarBox/index.js +231 -0
- package/PageSelector/index.js +180 -0
- package/PointDistances/index.js +73 -0
- package/PreventScrollToParents/index.js +51 -0
- package/RegionLabel/index.js +232 -0
- package/{src/RegionLabel → RegionLabel}/styles.js +12 -15
- package/RegionSelectAndTransformBoxes/index.js +169 -0
- package/RegionSelectorSidebarBox/index.js +254 -0
- package/{src/RegionSelectorSidebarBox → RegionSelectorSidebarBox}/styles.js +13 -14
- package/RegionShapes/index.js +294 -0
- package/RegionTags/index.js +144 -0
- package/SettingsDialog/index.js +52 -0
- package/SettingsProvider/index.js +60 -0
- package/Shortcuts/ShortcutField.js +46 -0
- package/Shortcuts/index.js +133 -0
- package/ShortcutsManager/index.js +155 -0
- package/Sidebar/index.js +69 -0
- package/SidebarBoxContainer/index.js +93 -0
- package/SmallToolButton/index.js +42 -0
- package/TagsSidebarBox/index.js +105 -0
- package/TaskDescriptionSidebarBox/index.js +58 -0
- package/Theme/index.js +30 -0
- package/VideoOrImageCanvasBackground/index.js +151 -0
- package/colors.js +14 -0
- package/hooks/use-colors.js +127 -0
- package/hooks/use-event-callback.js +10 -0
- package/hooks/use-exclude-pattern.js +24 -0
- package/hooks/use-load-image.js +26 -0
- package/hooks/use-window-size.js +46 -0
- package/{src/hooks → hooks}/xpattern.js +1 -1
- package/index.js +3 -0
- package/lib.js +3 -0
- package/package.json +1 -1
- package/stories.js +5 -0
- package/utils/blocks-to-article.js +60 -0
- package/{src/utils → utils}/blocks-to-article.test.js +5 -8
- package/{src/utils → utils}/default-locked-until.js +2 -1
- package/{src/utils → utils}/filter-only-unique.js +1 -1
- package/utils/get-from-local-storage.js +7 -0
- package/utils/get-hotkey-help-text.js +9 -0
- package/utils/get-landmarks-with-transform.js +40 -0
- package/utils/photosToImages.js +85 -0
- package/utils/regions-groups.js +28 -0
- package/utils/regions-to-blocks.js +18 -0
- package/utils/saveable-actions-enum.js +3 -0
- package/utils/set-in-local-storage.js +3 -0
- package/utils/sleep.js +7 -0
- package/utils/uuid-to-hash.js +5 -0
- package/.babelrc +0 -6
- package/.env +0 -1
- package/.flowconfig +0 -2
- package/.github/workflows/release-on-master.yml +0 -32
- package/.github/workflows/test.yml +0 -16
- package/.prettierrc +0 -3
- package/.releaserc.js +0 -18
- package/.storybook/addons.js +0 -2
- package/.storybook/config.js +0 -16
- package/LICENSE +0 -21
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -38
- package/src/Annotator/bike-pic.png +0 -0
- package/src/Annotator/bike-pic2.png +0 -0
- package/src/Annotator/dab-keyframes.story.json +0 -1
- package/src/Annotator/exampleImages.js +0 -48
- package/src/Annotator/examplePhotos.js +0 -7603
- package/src/Annotator/index.js +0 -380
- package/src/Annotator/index.story.js +0 -899
- package/src/Annotator/poses.story.js +0 -150
- package/src/Annotator/reducers/combine-reducers.js +0 -7
- package/src/Annotator/reducers/convert-expanding-line-to-polygon.js +0 -53
- package/src/Annotator/reducers/general-reducer.js +0 -1228
- package/src/Annotator/reducers/get-active-image.js +0 -21
- package/src/Annotator/reducers/get-implied-video-regions.js +0 -115
- package/src/Annotator/reducers/history-handler.js +0 -60
- package/src/Annotator/reducers/image-reducer.js +0 -23
- package/src/Annotator/reducers/video-reducer.js +0 -85
- package/src/Annotator/video.story.js +0 -51
- package/src/ClassSelectionMenu/index.js +0 -112
- package/src/Crosshairs/index.js +0 -64
- package/src/DebugSidebarBox/index.js +0 -36
- package/src/DemoSite/Editor.js +0 -235
- package/src/DemoSite/ErrorBoundaryDialog.js +0 -34
- package/src/DemoSite/index.js +0 -41
- package/src/DemoSite/index.story.js +0 -10
- package/src/DemoSite/simple-segmentation-example.json +0 -572
- package/src/Editor/annotation-plugin/annotation.js +0 -546
- package/src/Editor/index.js +0 -50
- package/src/Editor/readOnly.js +0 -31
- package/src/Errorer/index.js +0 -13
- package/src/FullImageSegmentationAnnotator/hard1.story.jpg +0 -0
- package/src/FullImageSegmentationAnnotator/hard2.story.jpg +0 -0
- package/src/FullImageSegmentationAnnotator/hard3.story.jpg +0 -0
- package/src/FullImageSegmentationAnnotator/index.js +0 -7
- package/src/FullImageSegmentationAnnotator/index.story.js +0 -177
- package/src/FullImageSegmentationAnnotator/orange.story.png +0 -0
- package/src/GroupSelectorSidebarBox/index.js +0 -48
- package/src/GroupsEditorSidebarBox/index.js +0 -108
- package/src/HelpSidebarBox/index.js +0 -43
- package/src/HighlightBox/index.js +0 -143
- package/src/HistorySidebarBox/index.js +0 -78
- package/src/ImageCanvas/dancing-man.story.jpg +0 -0
- package/src/ImageCanvas/index.js +0 -515
- package/src/ImageCanvas/index.story.js +0 -314
- package/src/ImageCanvas/mouse_mask.story.png +0 -0
- package/src/ImageCanvas/region-tools.js +0 -171
- package/src/ImageCanvas/seves_desk.story.jpg +0 -0
- package/src/ImageCanvas/use-mouse.js +0 -168
- package/src/ImageCanvas/use-project-box.js +0 -23
- package/src/ImageCanvas/use-wasd-mode.js +0 -50
- package/src/ImageMask/index.js +0 -127
- package/src/ImageMask/load-image.js +0 -32
- package/src/ImageSelectorSidebarBox/index.js +0 -54
- package/src/KeyframeTimeline/get-time-string.js +0 -25
- package/src/KeyframeTimeline/index.js +0 -223
- package/src/KeyframesSelectorSidebarBox/index.js +0 -93
- package/src/LandingPage/content.md +0 -57
- package/src/LandingPage/github-markdown.css +0 -964
- package/src/LandingPage/index.js +0 -147
- package/src/Locker/index.js +0 -13
- package/src/MainLayout/RightSidebarItemsWrapper.js +0 -21
- package/src/MainLayout/icon-dictionary.js +0 -79
- package/src/MainLayout/index.js +0 -564
- package/src/MainLayout/index.story.js +0 -240
- package/src/MainLayout/types.js +0 -171
- package/src/MainLayout/use-implied-video-regions.js +0 -17
- package/src/MetadataEditorSidebarBox/index.js +0 -160
- package/src/PageSelector/index.js +0 -159
- package/src/PointDistances/index.js +0 -90
- package/src/PreventScrollToParents/index.js +0 -48
- package/src/PreventScrollToParents/index.story.js +0 -23
- package/src/RegionLabel/index.js +0 -236
- package/src/RegionSelectAndTransformBoxes/index.js +0 -236
- package/src/RegionSelectorSidebarBox/index.js +0 -220
- package/src/RegionShapes/index.js +0 -254
- package/src/RegionTags/index.js +0 -136
- package/src/SettingsDialog/index.js +0 -58
- package/src/SettingsProvider/index.js +0 -57
- package/src/Shortcuts/ShortcutField.js +0 -44
- package/src/Shortcuts/index.js +0 -129
- package/src/ShortcutsManager/index.js +0 -162
- package/src/Sidebar/index.js +0 -117
- package/src/SidebarBoxContainer/index.js +0 -93
- package/src/SmallToolButton/index.js +0 -57
- package/src/TagsSidebarBox/index.js +0 -93
- package/src/TaskDescriptionSidebarBox/index.js +0 -43
- package/src/Theme/index.js +0 -36
- package/src/VideoOrImageCanvasBackground/index.js +0 -170
- package/src/colors.js +0 -32
- package/src/hooks/use-colors.js +0 -95
- package/src/hooks/use-event-callback.js +0 -11
- package/src/hooks/use-exclude-pattern.js +0 -27
- package/src/hooks/use-load-image.js +0 -21
- package/src/hooks/use-window-size.js +0 -46
- package/src/hooks/xpattern.png +0 -0
- package/src/index.js +0 -18
- package/src/lib.js +0 -7
- package/src/screenshot.png +0 -0
- package/src/site.css +0 -5
- package/src/stories.js +0 -2
- package/src/utils/blocks-to-article.js +0 -61
- package/src/utils/get-from-local-storage.js +0 -7
- package/src/utils/get-hotkey-help-text.js +0 -11
- package/src/utils/get-landmarks-with-transform.js +0 -23
- package/src/utils/photosToImages.js +0 -67
- package/src/utils/regions-groups.js +0 -19
- package/src/utils/regions-to-blocks.js +0 -16
- package/src/utils/saveable-actions-enum.js +0 -5
- package/src/utils/set-in-local-storage.js +0 -6
- package/src/utils/sleep.js +0 -3
- package/src/utils/uuid-to-hash.js +0 -5
- /package/{src/Editor → Editor}/annotation-plugin/annotation.css +0 -0
- /package/{src/Errorer → Errorer}/errorer.css +0 -0
- /package/{src/Locker → Locker}/locker.css +0 -0
- /package/{src/PageSelector → PageSelector}/page-selector.css +0 -0
- /package/{src/utils → utils}/next-group-id.js +0 -0
|
@@ -1,899 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import React, { useState } from "react"
|
|
4
|
-
|
|
5
|
-
import { storiesOf } from "@storybook/react"
|
|
6
|
-
import { action as actionAddon } from "@storybook/addon-actions"
|
|
7
|
-
import exampleImage from "../ImageCanvas/seves_desk.story.jpg"
|
|
8
|
-
import bikeImg1 from "./bike-pic.png"
|
|
9
|
-
import bikeImg2 from "./bike-pic2.png"
|
|
10
|
-
import { HotKeys } from "react-hotkeys"
|
|
11
|
-
import { defaultKeyMap } from "../ShortcutsManager"
|
|
12
|
-
|
|
13
|
-
import Annotator from "./"
|
|
14
|
-
|
|
15
|
-
import { testRegions, testRegionsBoxes } from "../ImageCanvas/index.story"
|
|
16
|
-
import photosToImages from "../utils/photosToImages"
|
|
17
|
-
import examplePhotos from "./examplePhotos"
|
|
18
|
-
import exampleImages from './exampleImages';
|
|
19
|
-
|
|
20
|
-
const middlewares = [
|
|
21
|
-
(store) => (next) => (action) => {
|
|
22
|
-
actionAddon(action.type)(action)
|
|
23
|
-
return next(action)
|
|
24
|
-
},
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
storiesOf("Annotator", module)
|
|
28
|
-
.add("Basic", () => (
|
|
29
|
-
<Annotator
|
|
30
|
-
onExit={actionAddon("onExit")}
|
|
31
|
-
middlewares={middlewares}
|
|
32
|
-
labelImages
|
|
33
|
-
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
34
|
-
regionTagList={["tag1", "tag2", "tag3"]}
|
|
35
|
-
imageClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
36
|
-
imageTagList={["tag1", "tag2", "tag3"]}
|
|
37
|
-
images={[
|
|
38
|
-
{
|
|
39
|
-
src: exampleImage,
|
|
40
|
-
name: "Seve's Desk",
|
|
41
|
-
regions: testRegions,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
src: "https://loremflickr.com/100/100/cars?lock=1",
|
|
45
|
-
name: "Frame 0036",
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
src: "https://loremflickr.com/100/100/cars?lock=2",
|
|
49
|
-
name: "Frame 0037",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
src: "https://loremflickr.com/100/100/cars?lock=3",
|
|
53
|
-
name: "Frame 0038",
|
|
54
|
-
},
|
|
55
|
-
]}
|
|
56
|
-
/>
|
|
57
|
-
))
|
|
58
|
-
.add("Basic with onImagesChange", () => (
|
|
59
|
-
<HotKeys keyMap={defaultKeyMap}>
|
|
60
|
-
<div>
|
|
61
|
-
<div >
|
|
62
|
-
<Annotator
|
|
63
|
-
middlewares={middlewares}
|
|
64
|
-
labelImages
|
|
65
|
-
regionClsList={[
|
|
66
|
-
"author",
|
|
67
|
-
"appendix",
|
|
68
|
-
"photo_author",
|
|
69
|
-
"photo_caption",
|
|
70
|
-
"advertisement",
|
|
71
|
-
"other_graphics",
|
|
72
|
-
"unknown",
|
|
73
|
-
"title",
|
|
74
|
-
"about_author",
|
|
75
|
-
"image",
|
|
76
|
-
"subtitle",
|
|
77
|
-
"interview",
|
|
78
|
-
"table",
|
|
79
|
-
"text",
|
|
80
|
-
"continuation_ref",
|
|
81
|
-
"cover_clip",
|
|
82
|
-
"page_id",
|
|
83
|
-
"continuation_mark",
|
|
84
|
-
"follow_up_mark",
|
|
85
|
-
"article_termination_mark",
|
|
86
|
-
"page_splitting_stripe",
|
|
87
|
-
"column_id_stripe",
|
|
88
|
-
"prev_page_reference",
|
|
89
|
-
"section_subcategory"
|
|
90
|
-
|
|
91
|
-
]}
|
|
92
|
-
help={`# Tools\n\n**E** - select tool\n\n**D** - frame tool\n\n**Ctrl** + **click frame** - edit frame\n\n**1**- **9** - change class`}
|
|
93
|
-
onImagesChange={(images) => console.log("[images changed to]:", images)}
|
|
94
|
-
images={photosToImages([examplePhotos[0]])}
|
|
95
|
-
clsColors={{
|
|
96
|
-
title: "#f70202",
|
|
97
|
-
subtitle: "#ffb405",
|
|
98
|
-
text: "#14deef",
|
|
99
|
-
author: "#f8d51e",
|
|
100
|
-
appendix: "#bfede2",
|
|
101
|
-
photo_author: "#9a17bb",
|
|
102
|
-
photo_caption: "#ff84f6",
|
|
103
|
-
advertisement: "#ffb201",
|
|
104
|
-
other_graphics: "#ff5400",
|
|
105
|
-
unknown: "#bfede2",
|
|
106
|
-
about_author: "#9a17bb",
|
|
107
|
-
image: "#14deef",
|
|
108
|
-
interview: "#23b20f",
|
|
109
|
-
table: "#02b4ba",
|
|
110
|
-
continuation_ref: '#FF33CC',
|
|
111
|
-
cover_clip: '#669966',
|
|
112
|
-
page_id: '#4433AA',
|
|
113
|
-
continuation_mark: '#660066',
|
|
114
|
-
follow_up_mark: '#873e23',
|
|
115
|
-
article_termination_mark: '#873e23',
|
|
116
|
-
page_splitting_stripe: '#873e23',
|
|
117
|
-
column_id_stripe: '#873e23',
|
|
118
|
-
prev_page_reference: '#f3a864',
|
|
119
|
-
section_subcategory: '#442c55',
|
|
120
|
-
|
|
121
|
-
}}
|
|
122
|
-
// groupColors={[
|
|
123
|
-
// "#3853F1",
|
|
124
|
-
// "#F6E54C",
|
|
125
|
-
// "#39D33C",
|
|
126
|
-
// "#CF24CF",
|
|
127
|
-
// "#22E3ED",
|
|
128
|
-
// "#EF3029",
|
|
129
|
-
// ]}
|
|
130
|
-
enabledTools={[]}
|
|
131
|
-
groupColors={['#343434', '#989898', '#dcdcdc']}
|
|
132
|
-
onGroupSelect={(groupId) => console.log('selected groupid:', groupId)}
|
|
133
|
-
hideHeader={true}
|
|
134
|
-
hideHistory={true}
|
|
135
|
-
hideNotEditingLabel={true}
|
|
136
|
-
showEditor={true}
|
|
137
|
-
showPageSelector={true}
|
|
138
|
-
albumMetadata={[{
|
|
139
|
-
key: "issueNumber", value: "12"
|
|
140
|
-
}, {
|
|
141
|
-
key: "issueType", value: "news"
|
|
142
|
-
}]}
|
|
143
|
-
metadataConfigs={[{
|
|
144
|
-
key: "issueNumber",
|
|
145
|
-
level: "album",
|
|
146
|
-
options: []
|
|
147
|
-
}, {
|
|
148
|
-
key: "issueType",
|
|
149
|
-
level: "album",
|
|
150
|
-
options: ['news', 'magazine', 'q&a']
|
|
151
|
-
}, {
|
|
152
|
-
key: "mutation",
|
|
153
|
-
level: "photo",
|
|
154
|
-
options: ['Morava', 'Slezsko', 'Cechy']
|
|
155
|
-
}, {
|
|
156
|
-
key: "previousArticleId",
|
|
157
|
-
level: "photo_metadata-engine",
|
|
158
|
-
options: [{
|
|
159
|
-
value: "alpha",
|
|
160
|
-
label: "0 - alpha"
|
|
161
|
-
}, {
|
|
162
|
-
value: "beta",
|
|
163
|
-
label: "1 - beta"
|
|
164
|
-
}, {
|
|
165
|
-
value: "gamma",
|
|
166
|
-
label: "2 - gamma"
|
|
167
|
-
}]
|
|
168
|
-
}, {
|
|
169
|
-
key: "pageNumber",
|
|
170
|
-
level: "photo",
|
|
171
|
-
options: []
|
|
172
|
-
}, {
|
|
173
|
-
key: "articleType",
|
|
174
|
-
level: "photo_metadata-engine",
|
|
175
|
-
// options: ['news', 'ads', 'interview']
|
|
176
|
-
selectable: true,
|
|
177
|
-
options: [{
|
|
178
|
-
value: "alpha",
|
|
179
|
-
label: "0 - alpha"
|
|
180
|
-
}, {
|
|
181
|
-
value: "beta",
|
|
182
|
-
label: "1 - beta"
|
|
183
|
-
}, {
|
|
184
|
-
value: "gamma",
|
|
185
|
-
label: "2 - gamma"
|
|
186
|
-
}]
|
|
187
|
-
}, {
|
|
188
|
-
key: "section",
|
|
189
|
-
level: "photo_metadata-engine",
|
|
190
|
-
options: ['editorial', 'article', 'last page']
|
|
191
|
-
}]}
|
|
192
|
-
onSelectedImageChange={(d) => console.log("[onSelectedImageChange] triggered:", d)}
|
|
193
|
-
onExit={(s) => console.log('[onExit] triggered:', s)}
|
|
194
|
-
save={async ({ image, triggerRecalc, albumMetadata }) => {
|
|
195
|
-
console.log(`[SYNC] image ${image.id} saving... recalc: ${triggerRecalc} albumMetadata: ${albumMetadata.length}`)
|
|
196
|
-
return new Promise((resolve, reject) => {
|
|
197
|
-
setTimeout(() => {
|
|
198
|
-
let lockedUntil = null;
|
|
199
|
-
if (triggerRecalc) {
|
|
200
|
-
var now = new Date();
|
|
201
|
-
now.setSeconds(now.getSeconds() + 60);
|
|
202
|
-
lockedUntil = now
|
|
203
|
-
}
|
|
204
|
-
resolve({ lockedUntil })
|
|
205
|
-
}, 3000)
|
|
206
|
-
})
|
|
207
|
-
}}
|
|
208
|
-
fetchImage={async ({ imageId }) => {
|
|
209
|
-
console.log(`[SYNC] image ${imageId} fetching...`)
|
|
210
|
-
return new Promise((resolve, reject) => {
|
|
211
|
-
setTimeout(() => {
|
|
212
|
-
console.log(`[SYNC] image ${imageId} fetched`,)
|
|
213
|
-
// resolve({
|
|
214
|
-
// image: { ...exampleImages[0], lockedUntil: new Date().toISOString(), id: imageId }
|
|
215
|
-
// })
|
|
216
|
-
resolve({
|
|
217
|
-
image: { ...exampleImages[0], lockedUntil: null, id: imageId }
|
|
218
|
-
})
|
|
219
|
-
}, 5000)
|
|
220
|
-
})
|
|
221
|
-
}}
|
|
222
|
-
/>
|
|
223
|
-
</div>
|
|
224
|
-
</div>
|
|
225
|
-
</HotKeys >
|
|
226
|
-
))
|
|
227
|
-
.add("Basic - Allow Comments", () => (
|
|
228
|
-
<Annotator
|
|
229
|
-
onExit={actionAddon("onExit")}
|
|
230
|
-
middlewares={middlewares}
|
|
231
|
-
labelImages
|
|
232
|
-
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
233
|
-
regionTagList={["tag1", "tag2", "tag3"]}
|
|
234
|
-
imageClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
235
|
-
imageTagList={["tag1", "tag2", "tag3"]}
|
|
236
|
-
images={[
|
|
237
|
-
{
|
|
238
|
-
src: exampleImage,
|
|
239
|
-
name: "Seve's Desk",
|
|
240
|
-
regions: testRegions,
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
src: "https://loremflickr.com/100/100/cars?lock=1",
|
|
244
|
-
name: "Frame 0036",
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
src: "https://loremflickr.com/100/100/cars?lock=2",
|
|
248
|
-
name: "Frame 0037",
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
src: "https://loremflickr.com/100/100/cars?lock=3",
|
|
252
|
-
name: "Frame 0038",
|
|
253
|
-
},
|
|
254
|
-
]}
|
|
255
|
-
allowComments
|
|
256
|
-
/>
|
|
257
|
-
))
|
|
258
|
-
.add("Fixed Size Container", () => (
|
|
259
|
-
<div style={{ width: 500, height: 500 }}>
|
|
260
|
-
<Annotator
|
|
261
|
-
onExit={actionAddon("onExit")}
|
|
262
|
-
middlewares={[
|
|
263
|
-
(store) => (next) => (action) => {
|
|
264
|
-
actionAddon(action.type)(action)
|
|
265
|
-
return next(action)
|
|
266
|
-
},
|
|
267
|
-
]}
|
|
268
|
-
labelImages
|
|
269
|
-
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
270
|
-
regionTagList={["tag1", "tag2", "tag3"]}
|
|
271
|
-
imageClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
272
|
-
imageTagList={["tag1", "tag2", "tag3"]}
|
|
273
|
-
images={[
|
|
274
|
-
{
|
|
275
|
-
src: exampleImage,
|
|
276
|
-
name: "Seve's Desk",
|
|
277
|
-
regions: testRegions,
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
src: "https://loremflickr.com/100/100/cars?lock=1",
|
|
281
|
-
name: "Frame 0036",
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
src: "https://loremflickr.com/100/100/cars?lock=2",
|
|
285
|
-
name: "Frame 0037",
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
src: "https://loremflickr.com/100/100/cars?lock=3",
|
|
289
|
-
name: "Frame 0038",
|
|
290
|
-
},
|
|
291
|
-
]}
|
|
292
|
-
/>
|
|
293
|
-
</div>
|
|
294
|
-
))
|
|
295
|
-
.add("Shrunk Annotator (Test Fullscreen)", () => (
|
|
296
|
-
<div style={{ padding: 100 }}>
|
|
297
|
-
<Annotator
|
|
298
|
-
onExit={actionAddon("onExit")}
|
|
299
|
-
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
300
|
-
regionTagList={["tag1", "tag2", "tag3"]}
|
|
301
|
-
middlewares={[
|
|
302
|
-
(store) => (next) => (action) => {
|
|
303
|
-
actionAddon(action.type)(action)
|
|
304
|
-
return next(action)
|
|
305
|
-
},
|
|
306
|
-
]}
|
|
307
|
-
images={[
|
|
308
|
-
{
|
|
309
|
-
src: exampleImage,
|
|
310
|
-
name: "Seve's Desk",
|
|
311
|
-
regions: testRegions,
|
|
312
|
-
},
|
|
313
|
-
]}
|
|
314
|
-
/>
|
|
315
|
-
</div>
|
|
316
|
-
))
|
|
317
|
-
.add("Annotator w/o No Region Labels or Image Labels", () => (
|
|
318
|
-
<Annotator
|
|
319
|
-
onExit={actionAddon("onExit")}
|
|
320
|
-
middlewares={middlewares}
|
|
321
|
-
images={[
|
|
322
|
-
{
|
|
323
|
-
src: exampleImage,
|
|
324
|
-
name: "Seve's Desk",
|
|
325
|
-
regions: testRegions,
|
|
326
|
-
},
|
|
327
|
-
]}
|
|
328
|
-
/>
|
|
329
|
-
))
|
|
330
|
-
.add("Annotator with no enabled tools", () => (
|
|
331
|
-
<Annotator
|
|
332
|
-
onExit={actionAddon("onExit")}
|
|
333
|
-
enabledTools={[]}
|
|
334
|
-
showTags={false}
|
|
335
|
-
middlewares={middlewares}
|
|
336
|
-
images={[
|
|
337
|
-
{
|
|
338
|
-
src: exampleImage,
|
|
339
|
-
name: "Seve's Desk",
|
|
340
|
-
regions: testRegions,
|
|
341
|
-
},
|
|
342
|
-
]}
|
|
343
|
-
/>
|
|
344
|
-
))
|
|
345
|
-
.add("Bounding Box Annotator with output to console.log", () => (
|
|
346
|
-
<Annotator
|
|
347
|
-
onExit={(out) => {
|
|
348
|
-
window.lastOutput = out
|
|
349
|
-
console.log(out)
|
|
350
|
-
}}
|
|
351
|
-
taskDescription={`## Annotate Hands\nDraw a bounding box around each hand.`}
|
|
352
|
-
enabledTools={["select", "create-box"]}
|
|
353
|
-
regionClsList={["Hand", "Face"]}
|
|
354
|
-
regionTagList={["Open Pinch", "Closed Pinch", "In Frame"]}
|
|
355
|
-
showTags={false}
|
|
356
|
-
images={[
|
|
357
|
-
{
|
|
358
|
-
src: "https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame017.png",
|
|
359
|
-
name: "Bounding Box Test",
|
|
360
|
-
regions: [],
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
src: "https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame001.png",
|
|
364
|
-
name: "Bounding Box Test",
|
|
365
|
-
regions: [],
|
|
366
|
-
},
|
|
367
|
-
]}
|
|
368
|
-
/>
|
|
369
|
-
))
|
|
370
|
-
.add("Bounding Box Annotator with allowed area", () => (
|
|
371
|
-
<Annotator
|
|
372
|
-
taskDescription={`## Annotate Hands\nDraw a bounding box around each hand.`}
|
|
373
|
-
enabledTools={["select", "create-box"]}
|
|
374
|
-
regionClsList={["Hand", "Face"]}
|
|
375
|
-
regionTagList={["Open Pinch", "Closed Pinch", "In Frame"]}
|
|
376
|
-
showTags={false}
|
|
377
|
-
allowedArea={{ x: 0, y: 0.6, w: 0.3, h: 0.3 }}
|
|
378
|
-
images={[
|
|
379
|
-
{
|
|
380
|
-
src: "https://s3.amazonaws.com/jobstorage.workaround.online/Atheer/video-frames/VID_20190111_161054.mp4_frame017.png",
|
|
381
|
-
name: "Bounding Box Test",
|
|
382
|
-
regions: [],
|
|
383
|
-
},
|
|
384
|
-
]}
|
|
385
|
-
/>
|
|
386
|
-
))
|
|
387
|
-
.add("Car Annotation", () => (
|
|
388
|
-
<Annotator
|
|
389
|
-
onExit={actionAddon("onExit")}
|
|
390
|
-
middlewares={middlewares}
|
|
391
|
-
labelImages
|
|
392
|
-
regionClsList={["Car", "Sign", "Construction Barrier"]}
|
|
393
|
-
regionTagList={["Moving", "Stopped", "Obstacle"]}
|
|
394
|
-
imageClsList={["On Street", "Sidewalk", "Other"]}
|
|
395
|
-
// imageTagList={["tag1", "tag2", "tag3"]}
|
|
396
|
-
images={[
|
|
397
|
-
{
|
|
398
|
-
src: bikeImg1,
|
|
399
|
-
name: "Frame 03021",
|
|
400
|
-
regions: [
|
|
401
|
-
{
|
|
402
|
-
cls: "Car",
|
|
403
|
-
color: "hsl(82,100%,50%)",
|
|
404
|
-
h: 0.45921666772960146,
|
|
405
|
-
w: 0.3932156342484836,
|
|
406
|
-
x: 0.6302148980776354,
|
|
407
|
-
y: 0.5559504689545722,
|
|
408
|
-
type: "box",
|
|
409
|
-
id: "8776160642957009",
|
|
410
|
-
tags: ["Stopped"],
|
|
411
|
-
highlighted: false,
|
|
412
|
-
editingLabels: false,
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
cls: "Car",
|
|
416
|
-
color: "hsl(264,100%,50%)",
|
|
417
|
-
type: "box",
|
|
418
|
-
id: "885140028730734",
|
|
419
|
-
tags: ["Moving"],
|
|
420
|
-
w: 0.2627711048576583,
|
|
421
|
-
x: 0.20751775748638238,
|
|
422
|
-
y: 0.5566583219431673,
|
|
423
|
-
h: 0.268717618171478,
|
|
424
|
-
highlighted: false,
|
|
425
|
-
editingLabels: false,
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
cls: "Car",
|
|
429
|
-
color: "hsl(127,100%,50%)",
|
|
430
|
-
w: 0.033016094117647055,
|
|
431
|
-
x: 0.5051247779336334,
|
|
432
|
-
y: 0.5396378545840628,
|
|
433
|
-
h: 0.03423999999999994,
|
|
434
|
-
type: "box",
|
|
435
|
-
id: "5952553512262024",
|
|
436
|
-
tags: ["Stopped"],
|
|
437
|
-
highlighted: false,
|
|
438
|
-
editingLabels: false,
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
type: "box",
|
|
442
|
-
x: 0.7847296794208894,
|
|
443
|
-
y: 0.3635007199404308,
|
|
444
|
-
w: 0.04871147880041349,
|
|
445
|
-
h: 0.10995961095800888,
|
|
446
|
-
highlighted: true,
|
|
447
|
-
editingLabels: false,
|
|
448
|
-
color: "hsl(268,100%,50%)",
|
|
449
|
-
id: "5647593040225252",
|
|
450
|
-
cls: "Sign",
|
|
451
|
-
},
|
|
452
|
-
],
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
src: bikeImg2,
|
|
456
|
-
name: "Frame 03022",
|
|
457
|
-
regions: [
|
|
458
|
-
{
|
|
459
|
-
type: "box",
|
|
460
|
-
x: 0.12226982552783494,
|
|
461
|
-
y: 0.5578947368421052,
|
|
462
|
-
w: 0.3301518695958121,
|
|
463
|
-
h: 0.33562583001232194,
|
|
464
|
-
highlighted: false,
|
|
465
|
-
editingLabels: false,
|
|
466
|
-
color: "hsl(171,100%,50%)",
|
|
467
|
-
id: "014393439034159128",
|
|
468
|
-
cls: "Car",
|
|
469
|
-
tags: ["Stopped"],
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
type: "box",
|
|
473
|
-
x: 0.5018477698901193,
|
|
474
|
-
y: 0.5954194079501558,
|
|
475
|
-
w: 0.07194249496837657,
|
|
476
|
-
h: 0.06826906557009338,
|
|
477
|
-
highlighted: false,
|
|
478
|
-
editingLabels: false,
|
|
479
|
-
color: "hsl(17,100%,50%)",
|
|
480
|
-
id: "02954614542034717",
|
|
481
|
-
cls: "Car",
|
|
482
|
-
tags: ["Moving"],
|
|
483
|
-
},
|
|
484
|
-
{
|
|
485
|
-
type: "box",
|
|
486
|
-
x: 0.6483083881082046,
|
|
487
|
-
y: 0.6217109311709718,
|
|
488
|
-
w: 0.08786544324705947,
|
|
489
|
-
h: 0.20450608002345438,
|
|
490
|
-
highlighted: true,
|
|
491
|
-
editingLabels: true,
|
|
492
|
-
color: "hsl(337,100%,50%)",
|
|
493
|
-
id: "9124138360972984",
|
|
494
|
-
cls: "Construction Barrier",
|
|
495
|
-
tags: ["Obstacle"],
|
|
496
|
-
},
|
|
497
|
-
{
|
|
498
|
-
type: "box",
|
|
499
|
-
x: 0.7628671305695606,
|
|
500
|
-
y: 0.6299511028935285,
|
|
501
|
-
w: 0.12734928166820647,
|
|
502
|
-
h: 0.2689292407634438,
|
|
503
|
-
highlighted: false,
|
|
504
|
-
editingLabels: false,
|
|
505
|
-
color: "hsl(89,100%,50%)",
|
|
506
|
-
id: "5960600741979638",
|
|
507
|
-
cls: "Construction Barrier",
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
type: "box",
|
|
511
|
-
x: 0.5871362440754417,
|
|
512
|
-
y: 0.6232091442114366,
|
|
513
|
-
w: 0.06562102723514573,
|
|
514
|
-
h: 0.15281773012741662,
|
|
515
|
-
highlighted: false,
|
|
516
|
-
editingLabels: false,
|
|
517
|
-
color: "hsl(326,100%,50%)",
|
|
518
|
-
id: "7955287536996538",
|
|
519
|
-
cls: "Construction Barrier",
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
type: "box",
|
|
523
|
-
x: 0.42943330004934643,
|
|
524
|
-
y: 0.6054718359824862,
|
|
525
|
-
w: 0.053210066743122564,
|
|
526
|
-
h: 0.054984658299147116,
|
|
527
|
-
highlighted: false,
|
|
528
|
-
editingLabels: false,
|
|
529
|
-
color: "hsl(66,100%,50%)",
|
|
530
|
-
id: "49573139861381166",
|
|
531
|
-
cls: "Car",
|
|
532
|
-
tags: ["Stopped"],
|
|
533
|
-
},
|
|
534
|
-
],
|
|
535
|
-
},
|
|
536
|
-
]}
|
|
537
|
-
onExit={(out) => {
|
|
538
|
-
window.lastOutput = out
|
|
539
|
-
console.log(JSON.stringify(out.images))
|
|
540
|
-
}}
|
|
541
|
-
/>
|
|
542
|
-
))
|
|
543
|
-
.add("Annotator blocks scroll from propagating", () => (
|
|
544
|
-
<div style={{ height: "200vh" }}>
|
|
545
|
-
<Annotator
|
|
546
|
-
onExit={actionAddon("onExit")}
|
|
547
|
-
showTags={false}
|
|
548
|
-
middlewares={[
|
|
549
|
-
(store) => (next) => (action) => {
|
|
550
|
-
actionAddon(action.type)(action)
|
|
551
|
-
return next(action)
|
|
552
|
-
},
|
|
553
|
-
]}
|
|
554
|
-
images={[
|
|
555
|
-
{
|
|
556
|
-
src: exampleImage,
|
|
557
|
-
name: "Seve's Desk",
|
|
558
|
-
regions: testRegions,
|
|
559
|
-
},
|
|
560
|
-
]}
|
|
561
|
-
/>
|
|
562
|
-
<div style={{ color: "red" }}>You shouldn't be able to see this</div>
|
|
563
|
-
</div>
|
|
564
|
-
))
|
|
565
|
-
.add("Annotator should not expand beyond parent", () => (
|
|
566
|
-
<div
|
|
567
|
-
style={{
|
|
568
|
-
width: "100vw",
|
|
569
|
-
height: "100vh",
|
|
570
|
-
padding: 100,
|
|
571
|
-
boxSizing: "border-box",
|
|
572
|
-
}}
|
|
573
|
-
>
|
|
574
|
-
<Annotator
|
|
575
|
-
onExit={actionAddon("onExit")}
|
|
576
|
-
showTags={false}
|
|
577
|
-
middlewares={[
|
|
578
|
-
(store) => (next) => (action) => {
|
|
579
|
-
actionAddon(action.type)(action)
|
|
580
|
-
return next(action)
|
|
581
|
-
},
|
|
582
|
-
]}
|
|
583
|
-
images={[
|
|
584
|
-
{
|
|
585
|
-
src: exampleImage,
|
|
586
|
-
name: "Seve's Desk",
|
|
587
|
-
regions: testRegions,
|
|
588
|
-
},
|
|
589
|
-
]}
|
|
590
|
-
/>
|
|
591
|
-
</div>
|
|
592
|
-
))
|
|
593
|
-
.add("Video with frames as each image", () => (
|
|
594
|
-
<div
|
|
595
|
-
style={{
|
|
596
|
-
width: "100vw",
|
|
597
|
-
height: "100vh",
|
|
598
|
-
boxSizing: "border-box",
|
|
599
|
-
}}
|
|
600
|
-
>
|
|
601
|
-
<Annotator
|
|
602
|
-
onExit={actionAddon("onExit")}
|
|
603
|
-
showTags={false}
|
|
604
|
-
middlewares={[
|
|
605
|
-
(store) => (next) => (action) => {
|
|
606
|
-
actionAddon(action.type)(action)
|
|
607
|
-
return next(action)
|
|
608
|
-
},
|
|
609
|
-
]}
|
|
610
|
-
images={[
|
|
611
|
-
{
|
|
612
|
-
src: "https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
|
|
613
|
-
frameTime: 0,
|
|
614
|
-
name: "Frame 1",
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
src: "https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4",
|
|
618
|
-
frameTime: 4500,
|
|
619
|
-
name: "Frame 2",
|
|
620
|
-
},
|
|
621
|
-
]}
|
|
622
|
-
/>
|
|
623
|
-
</div>
|
|
624
|
-
))
|
|
625
|
-
.add("Keyframe video", () => (
|
|
626
|
-
<div
|
|
627
|
-
style={{
|
|
628
|
-
width: "100vw",
|
|
629
|
-
height: "100vh",
|
|
630
|
-
boxSizing: "border-box",
|
|
631
|
-
}}
|
|
632
|
-
>
|
|
633
|
-
<Annotator
|
|
634
|
-
onExit={(...args) => {
|
|
635
|
-
console.log(...args)
|
|
636
|
-
actionAddon("onExit")(...args)
|
|
637
|
-
}}
|
|
638
|
-
showTags
|
|
639
|
-
videoSrc="https://s3.amazonaws.com/asset.workaround.online/SampleVideo_1280x720_1mb.mp4"
|
|
640
|
-
videoTime={1000}
|
|
641
|
-
keyframes={{
|
|
642
|
-
0: {
|
|
643
|
-
regions: [
|
|
644
|
-
{
|
|
645
|
-
type: "point",
|
|
646
|
-
x: 0.1608187134502924,
|
|
647
|
-
y: 0.5769980506822612,
|
|
648
|
-
highlighted: true,
|
|
649
|
-
editingLabels: false,
|
|
650
|
-
color: "hsl(238,100%,50%)",
|
|
651
|
-
id: "9995495728521284",
|
|
652
|
-
},
|
|
653
|
-
{
|
|
654
|
-
type: "box",
|
|
655
|
-
x: 0.089171974522293,
|
|
656
|
-
y: 0.36801132342533616,
|
|
657
|
-
w: 0.30573248407643316,
|
|
658
|
-
h: 0.4170794998820476,
|
|
659
|
-
highlighted: true,
|
|
660
|
-
editingLabels: false,
|
|
661
|
-
color: "hsl(263,100%,50%)",
|
|
662
|
-
id: "04858393322065635",
|
|
663
|
-
},
|
|
664
|
-
],
|
|
665
|
-
},
|
|
666
|
-
3333: {
|
|
667
|
-
regions: [
|
|
668
|
-
{
|
|
669
|
-
type: "point",
|
|
670
|
-
x: 0.1608187134502924,
|
|
671
|
-
y: 0.5769980506822612,
|
|
672
|
-
highlighted: true,
|
|
673
|
-
editingLabels: false,
|
|
674
|
-
color: "hsl(238,100%,50%)",
|
|
675
|
-
id: "9995495728521284",
|
|
676
|
-
},
|
|
677
|
-
{
|
|
678
|
-
type: "box",
|
|
679
|
-
x: 0.14861995753715496,
|
|
680
|
-
y: 0.0934182590233546,
|
|
681
|
-
w: 0.3163481953290871,
|
|
682
|
-
h: 0.7596131163010142,
|
|
683
|
-
highlighted: true,
|
|
684
|
-
editingLabels: false,
|
|
685
|
-
color: "hsl(263,100%,50%)",
|
|
686
|
-
id: "04858393322065635",
|
|
687
|
-
},
|
|
688
|
-
],
|
|
689
|
-
},
|
|
690
|
-
}}
|
|
691
|
-
/>
|
|
692
|
-
</div>
|
|
693
|
-
))
|
|
694
|
-
.add("Override Next/Prev Button Handling", () => {
|
|
695
|
-
const images = [
|
|
696
|
-
exampleImage,
|
|
697
|
-
"https://loremflickr.com/100/100/cars?lock=1",
|
|
698
|
-
"https://loremflickr.com/100/100/cars?lock=2",
|
|
699
|
-
]
|
|
700
|
-
const [selectedImageIndex, changeSelectedImageIndex] = useState(0)
|
|
701
|
-
|
|
702
|
-
return (
|
|
703
|
-
<Annotator
|
|
704
|
-
onExit={actionAddon("onExit")}
|
|
705
|
-
onNextImage={() => {
|
|
706
|
-
actionAddon("onNextImage")()
|
|
707
|
-
changeSelectedImageIndex((selectedImageIndex + 1) % 3)
|
|
708
|
-
}}
|
|
709
|
-
onPrevImage={() => {
|
|
710
|
-
actionAddon("onPrevImage")()
|
|
711
|
-
changeSelectedImageIndex((selectedImageIndex - 1 + 3) % 3)
|
|
712
|
-
}}
|
|
713
|
-
labelImages
|
|
714
|
-
selectedImage={images[selectedImageIndex]}
|
|
715
|
-
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
716
|
-
imageClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
717
|
-
images={[
|
|
718
|
-
{
|
|
719
|
-
src: exampleImage,
|
|
720
|
-
name: "Seve's Desk",
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
src: images[1],
|
|
724
|
-
name: "Frame 0036",
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
src: images[2],
|
|
728
|
-
name: "Frame 0037",
|
|
729
|
-
},
|
|
730
|
-
]}
|
|
731
|
-
/>
|
|
732
|
-
)
|
|
733
|
-
})
|
|
734
|
-
.add("Override RegionEditLabel", () => {
|
|
735
|
-
const images = [
|
|
736
|
-
exampleImage,
|
|
737
|
-
"https://loremflickr.com/100/100/cars?lock=1",
|
|
738
|
-
"https://loremflickr.com/100/100/cars?lock=2",
|
|
739
|
-
]
|
|
740
|
-
|
|
741
|
-
const NewRegionEditLabel = ({
|
|
742
|
-
region,
|
|
743
|
-
editing,
|
|
744
|
-
onDelete,
|
|
745
|
-
onChange,
|
|
746
|
-
onClose,
|
|
747
|
-
onOpen,
|
|
748
|
-
}) => {
|
|
749
|
-
return (
|
|
750
|
-
<div style={{ backgroundColor: "white" }}>
|
|
751
|
-
I'm the closed part
|
|
752
|
-
<div style={{ display: editing ? "block" : "none" }}>
|
|
753
|
-
I'm the part that shows when it's being edited!
|
|
754
|
-
<button onClick={() => onDelete(region)}>Delete This Region</button>
|
|
755
|
-
<button
|
|
756
|
-
onClick={() => onChange({ ...region, cls: "awesome-value" })}
|
|
757
|
-
>
|
|
758
|
-
Set Classification to "awesome-value"
|
|
759
|
-
</button>
|
|
760
|
-
<button onClick={() => onClose(region)}>Close the edit mode</button>
|
|
761
|
-
</div>
|
|
762
|
-
</div>
|
|
763
|
-
)
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
return (
|
|
767
|
-
<Annotator
|
|
768
|
-
onExit={actionAddon("onExit")}
|
|
769
|
-
labelImages
|
|
770
|
-
selectedImage={images[0]}
|
|
771
|
-
RegionEditLabel={NewRegionEditLabel}
|
|
772
|
-
images={[
|
|
773
|
-
{
|
|
774
|
-
src: exampleImage,
|
|
775
|
-
name: "Seve's Desk",
|
|
776
|
-
},
|
|
777
|
-
{
|
|
778
|
-
src: images[1],
|
|
779
|
-
name: "Frame 0036",
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
src: images[2],
|
|
783
|
-
name: "Frame 0037",
|
|
784
|
-
},
|
|
785
|
-
]}
|
|
786
|
-
/>
|
|
787
|
-
)
|
|
788
|
-
})
|
|
789
|
-
.add("Two on sample page w/ hotkeys", () => {
|
|
790
|
-
return (
|
|
791
|
-
<HotKeys keyMap={defaultKeyMap}>
|
|
792
|
-
<div>
|
|
793
|
-
<div style={{ height: 600 }}>
|
|
794
|
-
<Annotator
|
|
795
|
-
onExit={actionAddon("onExit")}
|
|
796
|
-
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
797
|
-
imageClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
798
|
-
middlewares={[
|
|
799
|
-
(store) => (next) => (action) => {
|
|
800
|
-
actionAddon(action.type)(action)
|
|
801
|
-
return next(action)
|
|
802
|
-
},
|
|
803
|
-
]}
|
|
804
|
-
images={[
|
|
805
|
-
{
|
|
806
|
-
src: exampleImage,
|
|
807
|
-
name: "Seve's Desk",
|
|
808
|
-
regions: testRegions,
|
|
809
|
-
},
|
|
810
|
-
]}
|
|
811
|
-
/>
|
|
812
|
-
</div>
|
|
813
|
-
<div style={{ height: 600 }}>
|
|
814
|
-
<Annotator
|
|
815
|
-
onExit={actionAddon("onExit")}
|
|
816
|
-
middlewares={[
|
|
817
|
-
(store) => (next) => (action) => {
|
|
818
|
-
actionAddon(action.type)(action)
|
|
819
|
-
return next(action)
|
|
820
|
-
},
|
|
821
|
-
]}
|
|
822
|
-
images={[
|
|
823
|
-
{
|
|
824
|
-
src: exampleImage,
|
|
825
|
-
name: "Seve's Desk",
|
|
826
|
-
regions: testRegions,
|
|
827
|
-
},
|
|
828
|
-
]}
|
|
829
|
-
/>
|
|
830
|
-
</div>
|
|
831
|
-
</div>
|
|
832
|
-
</HotKeys>
|
|
833
|
-
)
|
|
834
|
-
})
|
|
835
|
-
.add("CORs Error (Pixel Segmentation)", () => (
|
|
836
|
-
<Annotator
|
|
837
|
-
onExit={actionAddon("onExit")}
|
|
838
|
-
middlewares={middlewares}
|
|
839
|
-
labelImages
|
|
840
|
-
fullImageSegmentationMode
|
|
841
|
-
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
842
|
-
images={[
|
|
843
|
-
{
|
|
844
|
-
src: "https://placebear.com/200/300",
|
|
845
|
-
name: "Frame 0036",
|
|
846
|
-
},
|
|
847
|
-
]}
|
|
848
|
-
/>
|
|
849
|
-
))
|
|
850
|
-
.add("Modify Allowed Area", () => (
|
|
851
|
-
<Annotator
|
|
852
|
-
onExit={actionAddon("onExit")}
|
|
853
|
-
middlewares={middlewares}
|
|
854
|
-
labelImages
|
|
855
|
-
fullImageSegmentationMode
|
|
856
|
-
allowedArea={{ x: 0, y: 0.6, w: 0.3, h: 0.3 }}
|
|
857
|
-
enabledTools={["modify-allowed-area"]}
|
|
858
|
-
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
859
|
-
images={[
|
|
860
|
-
{
|
|
861
|
-
src: exampleImage,
|
|
862
|
-
name: "Frame 0036",
|
|
863
|
-
},
|
|
864
|
-
]}
|
|
865
|
-
/>
|
|
866
|
-
))
|
|
867
|
-
.add("Hide Next, Hide Header Text", () => (
|
|
868
|
-
<Annotator
|
|
869
|
-
onExit={actionAddon("onExit")}
|
|
870
|
-
labelImages
|
|
871
|
-
hideNext
|
|
872
|
-
hideHeaderText
|
|
873
|
-
fullImageSegmentationMode
|
|
874
|
-
enabledTools={["modify-allowed-area"]}
|
|
875
|
-
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
876
|
-
images={[
|
|
877
|
-
{
|
|
878
|
-
src: exampleImage,
|
|
879
|
-
name: "Frame 0036",
|
|
880
|
-
},
|
|
881
|
-
]}
|
|
882
|
-
/>
|
|
883
|
-
))
|
|
884
|
-
.add("Hide Header", () => (
|
|
885
|
-
<Annotator
|
|
886
|
-
onExit={actionAddon("onExit")}
|
|
887
|
-
labelImages
|
|
888
|
-
hideHeader
|
|
889
|
-
fullImageSegmentationMode
|
|
890
|
-
enabledTools={["modify-allowed-area"]}
|
|
891
|
-
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
|
|
892
|
-
images={[
|
|
893
|
-
{
|
|
894
|
-
src: exampleImage,
|
|
895
|
-
name: "Frame 0036",
|
|
896
|
-
},
|
|
897
|
-
]}
|
|
898
|
-
/>
|
|
899
|
-
))
|