Skip to content

Commit 53296d1

Browse files
Michael Malyukshevchenkonik
authored andcommitted
Update of Image (#72)
* rect draw and multi toName * Fix bug in examples * Release v.0.1.5
1 parent 3f2d48c commit 53296d1

File tree

10 files changed

+31
-39
lines changed

10 files changed

+31
-39
lines changed

build/asset-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"main.css": "/static/css/main.f5b8907f.chunk.css",
3-
"main.js": "/static/js/main.a2c27cc1.chunk.js",
3+
"main.js": "/static/js/main.e16f17f7.chunk.js",
44
"static/css/1.47956429.chunk.css": "/static/css/1.47956429.chunk.css",
55
"static/js/1.0c48412c.chunk.js": "/static/js/1.0c48412c.chunk.js",
66
"runtime~main.js": "/static/js/runtime~main.229c360f.js",
77
"static/media/semantic.min.css": "/static/media/brand-icons.a1a749e8.svg",
88
"static/media/config.xml": "/static/media/config.c5233796.xml",
99
"index.html": "/index.html",
10-
"precache-manifest.5da957b4f41a252eb324f07e803b7caf.js": "/precache-manifest.5da957b4f41a252eb324f07e803b7caf.js",
10+
"precache-manifest.370322865dee12930a1efa06c0ad02c8.js": "/precache-manifest.370322865dee12930a1efa06c0ad02c8.js",
1111
"service-worker.js": "/service-worker.js"
1212
}

build/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600|Roboto Mono" rel="stylesheet"/><link href="//fonts.googleapis.com/css?family=Dosis:500&text=LabelStudio" rel="stylesheet"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="stylesheet" href="/styles/main.css"><title>Label Studio</title><link href="/static/css/1.47956429.chunk.css" rel="stylesheet"><link href="/static/css/main.f5b8907f.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="header"><a id="logo" href="/"><img src="./images/ls_logo.png" alt="label studio logo"> <span style="font-size:1.2em">Label Studio</span></a><ul id="nav" style="display:flex;align-items:center"><a style="margin-right:1em;text-decoration:underline" href="https://labelstud.io/guide">Guide</a> <a class="github-button" href="https://github.com/heartexlabs/label-studio" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star heartexlabs/label-studio on GitHub">Star</a></ul></div><div id="label-studio"></div><footer class="footer">Made by <a target="_blank" href="https://heartex.net">Heartex</a> in San Francisco<br/><br/><img src="./images/3nowhite.svg" height="80"/></footer><script async defer="defer" src="https://buttons.github.io/buttons.js"></script><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={2:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/1.0c48412c.chunk.js"></script><script src="/static/js/main.a2c27cc1.chunk.js"></script></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600|Roboto Mono" rel="stylesheet"/><link href="//fonts.googleapis.com/css?family=Dosis:500&text=LabelStudio" rel="stylesheet"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="stylesheet" href="/styles/main.css"><title>Label Studio</title><link href="/static/css/1.47956429.chunk.css" rel="stylesheet"><link href="/static/css/main.f5b8907f.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="header"><a id="logo" href="/"><img src="./images/ls_logo.png" alt="label studio logo"> <span style="font-size:1.2em">Label Studio</span></a><ul id="nav" style="display:flex;align-items:center"><a style="margin-right:1em;text-decoration:underline" href="https://labelstud.io/guide">Guide</a> <a class="github-button" href="https://github.com/heartexlabs/label-studio" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star heartexlabs/label-studio on GitHub">Star</a></ul></div><div id="label-studio"></div><footer class="footer">Made by <a target="_blank" href="https://heartex.net">Heartex</a> in San Francisco<br/><br/><img src="./images/3nowhite.svg" height="80"/></footer><script async defer="defer" src="https://buttons.github.io/buttons.js"></script><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={2:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/1.0c48412c.chunk.js"></script><script src="/static/js/main.e16f17f7.chunk.js"></script></body></html>

build/precache-manifest.5da957b4f41a252eb324f07e803b7caf.js renamed to build/precache-manifest.370322865dee12930a1efa06c0ad02c8.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ self.__precacheManifest = [
44
"url": "/static/media/outline-icons.cd6c777f.woff2"
55
},
66
{
7-
"revision": "a2c27cc1714ad81ad6ae",
7+
"revision": "e16f17f7bd25e2642970",
88
"url": "/static/css/main.f5b8907f.chunk.css"
99
},
1010
{
@@ -64,8 +64,8 @@ self.__precacheManifest = [
6464
"url": "/static/media/config.1890026d.xml"
6565
},
6666
{
67-
"revision": "a2c27cc1714ad81ad6ae",
68-
"url": "/static/js/main.a2c27cc1.chunk.js"
67+
"revision": "e16f17f7bd25e2642970",
68+
"url": "/static/js/main.e16f17f7.chunk.js"
6969
},
7070
{
7171
"revision": "ef60a4f6c25ef7f39f2d25a748dbecfe",
@@ -99,10 +99,6 @@ self.__precacheManifest = [
9999
"revision": "9c74e172f87984c48ddf5c8108cabe67",
100100
"url": "/static/media/flags.9c74e172.png"
101101
},
102-
{
103-
"revision": "b87b9ba532ace76ae9f6edfe9f72ded2",
104-
"url": "/static/media/icons.b87b9ba5.ttf"
105-
},
106102
{
107103
"revision": "8e3c7f5520f5ae906c6cf6d7f3ddcd19",
108104
"url": "/static/media/icons.8e3c7f55.eot"
@@ -111,6 +107,10 @@ self.__precacheManifest = [
111107
"revision": "13db00b7a34fee4d819ab7f9838cc428",
112108
"url": "/static/media/brand-icons.13db00b7.eot"
113109
},
110+
{
111+
"revision": "b87b9ba532ace76ae9f6edfe9f72ded2",
112+
"url": "/static/media/icons.b87b9ba5.ttf"
113+
},
114114
{
115115
"revision": "c5ebe0b32dc1b5cc449a76c4204d13bb",
116116
"url": "/static/media/brand-icons.c5ebe0b3.ttf"
@@ -128,7 +128,7 @@ self.__precacheManifest = [
128128
"url": "/static/css/1.47956429.chunk.css"
129129
},
130130
{
131-
"revision": "f9d8c06bdfa7bc79d34951fabaf7e394",
131+
"revision": "66ef6f2c625fc2d3e3601dd5160f6c25",
132132
"url": "/index.html"
133133
}
134134
];

build/service-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
1515

1616
importScripts(
17-
"/precache-manifest.5da957b4f41a252eb324f07e803b7caf.js"
17+
"/precache-manifest.370322865dee12930a1efa06c0ad02c8.js"
1818
);
1919

2020
workbox.clientsClaim();

build/static/js/main.a2c27cc1.chunk.js renamed to build/static/js/main.e16f17f7.chunk.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/themes/htx/source/css/_header.styl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ body.docs
4040
display: inline-block
4141
position: relative
4242
margin: 0 .6em
43+
span
44+
font-weight: bold;
4345
a
44-
text-decoration: underline;
46+
&:hover, &.current
47+
border-bottom: 2px solid $green
4548
.nav-dropdown
4649
.nav-link
4750
&:hover, &.current

examples/image_bbox/completions/1.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"completions": [
33
{
4-
"id": 1001,
54
"result": [
65
{
76
"from_name": "tag",
@@ -28,4 +27,4 @@
2827
},
2928
"id": 1,
3029
"task_path": "../examples/image_bbox/tasks.json"
31-
}
30+
}

examples/image_multilabel/completions/1.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"completions": [
33
{
4-
"id": 1001,
54
"result": [
65
{
76
"from_name": "tag",
@@ -39,4 +38,4 @@
3938
},
4039
"id": 1,
4140
"task_path": "../examples/image_multilabel/tasks.json"
42-
}
41+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "label-studio",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"private": true,
55
"description": "Label Studio is a multi-domain data labeling tool with standardized output format",
66
"author": {

src/interfaces/object/Image.js

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -204,22 +204,15 @@ const Model = types
204204
const { x1, y1, x2, y2 } = reverseCoords({ x: shape._start_x, y: shape._start_y }, { x: x, y: y });
205205

206206
shape.setPosition(x1, y1, x2 - x1, y2 - y1);
207-
208-
// // update rubber rect position
209-
// posNow = {x: posIn.x, y: posIn.y};
210-
// var posRect = reverse(posStart,posNow);
211-
// r2.x(posRect.x1);
212-
// r2.y(posRect.y1);
213-
// r2.width(posRect.x2 - posRect.x1);
214-
// r2.height(posRect.y2 - posRect.y1);
215-
// r2.visible(true);
216-
217-
// s1.draw(); // redraw any changes.
218207
},
219208

220209
lookupStates(ev, fun) {
221210
const states = self.completion.toNames.get(self.name);
222-
const activeStates = states ? states.filter(c => c.isSelected == true) : null;
211+
const activeStates = states
212+
? states
213+
.filter(c => c.isSelected == true)
214+
.filter(c => c.type == "rectanglelabels" || c.type == "keypointlabels" || c.type == "polygonlabels")
215+
: null;
223216
const clonedStates = activeStates ? activeStates.map(s => cloneNode(s)) : null;
224217

225218
if (clonedStates.length !== 0) {
@@ -230,7 +223,7 @@ const Model = types
230223

231224
onImageClick(ev) {
232225
const dispmap = {
233-
RectangleModel: ev => self._addRectEv(ev),
226+
// RectangleModel: ev => self._addRectEv(ev),
234227
PolygonModel: ev => self._addPolyEv(ev),
235228
KeyPointModel: ev => self._addKeyPointEv(ev),
236229

@@ -244,9 +237,9 @@ const Model = types
244237
KeyPointLabelsModel: ev => {
245238
self.lookupStates(ev, self._addKeyPointEv);
246239
},
247-
RectangleLabelsModel: ev => {
248-
self.lookupStates(ev, self._addRectEv);
249-
},
240+
// RectangleLabelsModel: ev => {
241+
// self.lookupStates(ev, self._addRectEv);
242+
// },
250243
};
251244

252245
if (dispmap[self.controlButtonType]) return dispmap[self.controlButtonType](ev);
@@ -311,7 +304,7 @@ const Model = types
311304
const wx = ev.evt.offsetX;
312305
const wy = ev.evt.offsetY;
313306

314-
self._addRect(Math.floor(wx - sw / 2), Math.floor(wy - sh / 2), sw, sh, stroke, states);
307+
return self._addRect(Math.floor(wx - sw / 2), Math.floor(wy - sh / 2), sw, sh, stroke, states);
315308
},
316309

317310
_addRect(x, y, sw, sh, stroke, states, coordstype, noadd) {
@@ -653,9 +646,7 @@ class HtxImageView extends Component {
653646
const x = (e.evt.offsetX - item.zoomPosX) / item.zoomScale;
654647
const y = (e.evt.offsetY - item.zoomPosY) / item.zoomScale;
655648

656-
if (item.controlButtonType !== "RectangleLabelsModel") {
657-
item.startDraw({ x: x, y: y });
658-
}
649+
item.startDraw({ x: x, y: y });
659650

660651
return;
661652
}

0 commit comments

Comments
 (0)