Skip to content

Commit

Permalink
Update of Image (#72)
Browse files Browse the repository at this point in the history
* rect draw and multi toName

* Fix bug in examples

* Release v.0.1.5
  • Loading branch information
Michael Malyuk authored and shevchenkonik committed Oct 1, 2019
1 parent 3f2d48c commit 53296d1
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 39 deletions.
4 changes: 2 additions & 2 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"main.css": "/static/css/main.f5b8907f.chunk.css",
"main.js": "/static/js/main.a2c27cc1.chunk.js",
"main.js": "/static/js/main.e16f17f7.chunk.js",
"static/css/1.47956429.chunk.css": "/static/css/1.47956429.chunk.css",
"static/js/1.0c48412c.chunk.js": "/static/js/1.0c48412c.chunk.js",
"runtime~main.js": "/static/js/runtime~main.229c360f.js",
"static/media/semantic.min.css": "/static/media/brand-icons.a1a749e8.svg",
"static/media/config.xml": "/static/media/config.c5233796.xml",
"index.html": "/index.html",
"precache-manifest.5da957b4f41a252eb324f07e803b7caf.js": "/precache-manifest.5da957b4f41a252eb324f07e803b7caf.js",
"precache-manifest.370322865dee12930a1efa06c0ad02c8.js": "/precache-manifest.370322865dee12930a1efa06c0ad02c8.js",
"service-worker.js": "/service-worker.js"
}
2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
@@ -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>
<!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>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ self.__precacheManifest = [
"url": "/static/media/outline-icons.cd6c777f.woff2"
},
{
"revision": "a2c27cc1714ad81ad6ae",
"revision": "e16f17f7bd25e2642970",
"url": "/static/css/main.f5b8907f.chunk.css"
},
{
Expand Down Expand Up @@ -64,8 +64,8 @@ self.__precacheManifest = [
"url": "/static/media/config.1890026d.xml"
},
{
"revision": "a2c27cc1714ad81ad6ae",
"url": "/static/js/main.a2c27cc1.chunk.js"
"revision": "e16f17f7bd25e2642970",
"url": "/static/js/main.e16f17f7.chunk.js"
},
{
"revision": "ef60a4f6c25ef7f39f2d25a748dbecfe",
Expand Down Expand Up @@ -99,10 +99,6 @@ self.__precacheManifest = [
"revision": "9c74e172f87984c48ddf5c8108cabe67",
"url": "/static/media/flags.9c74e172.png"
},
{
"revision": "b87b9ba532ace76ae9f6edfe9f72ded2",
"url": "/static/media/icons.b87b9ba5.ttf"
},
{
"revision": "8e3c7f5520f5ae906c6cf6d7f3ddcd19",
"url": "/static/media/icons.8e3c7f55.eot"
Expand All @@ -111,6 +107,10 @@ self.__precacheManifest = [
"revision": "13db00b7a34fee4d819ab7f9838cc428",
"url": "/static/media/brand-icons.13db00b7.eot"
},
{
"revision": "b87b9ba532ace76ae9f6edfe9f72ded2",
"url": "/static/media/icons.b87b9ba5.ttf"
},
{
"revision": "c5ebe0b32dc1b5cc449a76c4204d13bb",
"url": "/static/media/brand-icons.c5ebe0b3.ttf"
Expand All @@ -128,7 +128,7 @@ self.__precacheManifest = [
"url": "/static/css/1.47956429.chunk.css"
},
{
"revision": "f9d8c06bdfa7bc79d34951fabaf7e394",
"revision": "66ef6f2c625fc2d3e3601dd5160f6c25",
"url": "/index.html"
}
];
2 changes: 1 addition & 1 deletion build/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");

importScripts(
"/precache-manifest.5da957b4f41a252eb324f07e803b7caf.js"
"/precache-manifest.370322865dee12930a1efa06c0ad02c8.js"
);

workbox.clientsClaim();
Expand Down

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion docs/themes/htx/source/css/_header.styl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ body.docs
display: inline-block
position: relative
margin: 0 .6em
span
font-weight: bold;
a
text-decoration: underline;
&:hover, &.current
border-bottom: 2px solid $green
.nav-dropdown
.nav-link
&:hover, &.current
Expand Down
3 changes: 1 addition & 2 deletions examples/image_bbox/completions/1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"completions": [
{
"id": 1001,
"result": [
{
"from_name": "tag",
Expand All @@ -28,4 +27,4 @@
},
"id": 1,
"task_path": "../examples/image_bbox/tasks.json"
}
}
3 changes: 1 addition & 2 deletions examples/image_multilabel/completions/1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"completions": [
{
"id": 1001,
"result": [
{
"from_name": "tag",
Expand Down Expand Up @@ -39,4 +38,4 @@
},
"id": 1,
"task_path": "../examples/image_multilabel/tasks.json"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "label-studio",
"version": "0.1.4",
"version": "0.1.5",
"private": true,
"description": "Label Studio is a multi-domain data labeling tool with standardized output format",
"author": {
Expand Down
31 changes: 11 additions & 20 deletions src/interfaces/object/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,15 @@ const Model = types
const { x1, y1, x2, y2 } = reverseCoords({ x: shape._start_x, y: shape._start_y }, { x: x, y: y });

shape.setPosition(x1, y1, x2 - x1, y2 - y1);

// // update rubber rect position
// posNow = {x: posIn.x, y: posIn.y};
// var posRect = reverse(posStart,posNow);
// r2.x(posRect.x1);
// r2.y(posRect.y1);
// r2.width(posRect.x2 - posRect.x1);
// r2.height(posRect.y2 - posRect.y1);
// r2.visible(true);

// s1.draw(); // redraw any changes.
},

lookupStates(ev, fun) {
const states = self.completion.toNames.get(self.name);
const activeStates = states ? states.filter(c => c.isSelected == true) : null;
const activeStates = states
? states
.filter(c => c.isSelected == true)
.filter(c => c.type == "rectanglelabels" || c.type == "keypointlabels" || c.type == "polygonlabels")
: null;
const clonedStates = activeStates ? activeStates.map(s => cloneNode(s)) : null;

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

onImageClick(ev) {
const dispmap = {
RectangleModel: ev => self._addRectEv(ev),
// RectangleModel: ev => self._addRectEv(ev),
PolygonModel: ev => self._addPolyEv(ev),
KeyPointModel: ev => self._addKeyPointEv(ev),

Expand All @@ -244,9 +237,9 @@ const Model = types
KeyPointLabelsModel: ev => {
self.lookupStates(ev, self._addKeyPointEv);
},
RectangleLabelsModel: ev => {
self.lookupStates(ev, self._addRectEv);
},
// RectangleLabelsModel: ev => {
// self.lookupStates(ev, self._addRectEv);
// },
};

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

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

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

if (item.controlButtonType !== "RectangleLabelsModel") {
item.startDraw({ x: x, y: y });
}
item.startDraw({ x: x, y: y });

return;
}
Expand Down

0 comments on commit 53296d1

Please sign in to comment.