Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atlas plugins #16

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
12cbc64
webpack development config
louis-aiherd Nov 19, 2021
5a4107a
wip:keypointsa-atlas plugin
louis-aiherd Nov 19, 2021
e78b517
WIP: add capacity to navigate through image patches
camilledupont Nov 29, 2021
bc381c2
wip:keypointsa-atlas plugin
louis-aiherd Nov 19, 2021
01051ff
Add default settings for keypoints-atlas
camilledupont Dec 1, 2021
ccc99af
small fixes
louis-aiherd Dec 10, 2021
9a84450
bugfix: undo
louis-aiherd Dec 14, 2021
5e18a7d
bugfix: redo
louis-aiherd Dec 14, 2021
e96b750
bugfix: undo on last frame
louis-aiherd Dec 14, 2021
73e1a1f
bugfix: undo/redo buttons
louis-aiherd Dec 14, 2021
8473505
feat: change modified points opacity
louis-aiherd Dec 14, 2021
1e10a6b
bugfix: resize canvas on window resize
louis-aiherd Dec 14, 2021
4b5458b
bugfix: keypoints default colors
louis-aiherd Dec 15, 2021
4f42a57
bugfix: image skip; feat: go to prev / next image using shortcuts
louis-aiherd Dec 15, 2021
862fd9b
bugfix: setNextImageIndex between 0 and imagesPerAtlas - 1
louis-aiherd Dec 17, 2021
b422060
bugfix: moved onActivate() body to firstUpdated() body
louis-aiherd Dec 17, 2021
7a9e610
feat: start validation with image index 0
louis-aiherd Dec 17, 2021
814117c
bugfix: reset imageIndex in newData()
louis-aiherd Dec 20, 2021
3a18501
bugfix: prevent the counter from exceeding the total count of images …
louis-aiherd Dec 21, 2021
3a1d412
feat: brightness controls
louis-aiherd Jan 4, 2022
c0c69c8
labels atlas plugin
louis-aiherd Dec 13, 2021
7b471df
feat: brightness controls
louis-aiherd Jan 24, 2022
6dcc785
feat: skip image
louis-aiherd Jan 24, 2022
c813852
fixes
louis-aiherd Jan 26, 2022
549ae38
bugfix: initial image index in validation mode
louis-aiherd Feb 3, 2022
269af67
bugfix: keyup event listener set more than once
louis-aiherd Feb 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip:keypointsa-atlas plugin
louis-aiherd committed Nov 19, 2021
commit 5a4107a51aa77b8052e4908cc66254835f2dbb0c
Binary file added data-test/atlases/test.jpg
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 data-test/db.ldb/000005.ldb
Binary file not shown.
Binary file added data-test/db.ldb/000008.ldb
Binary file not shown.
Binary file added data-test/db.ldb/000011.ldb
Binary file not shown.
1 change: 1 addition & 0 deletions data-test/db.ldb/CURRENT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MANIFEST-000010
Empty file added data-test/db.ldb/LOCK
Empty file.
5 changes: 5 additions & 0 deletions data-test/db.ldb/LOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
2021/11/19-09:31:43.688486 70000bfc9000 Recovering log #9
2021/11/19-09:31:43.689395 70000bfc9000 Level-0 table #11: started
2021/11/19-09:31:43.690027 70000bfc9000 Level-0 table #11: 3979 bytes OK
2021/11/19-09:31:43.691652 70000bfc9000 Delete type=3 #7
2021/11/19-09:31:43.691811 70000bfc9000 Delete type=0 #9
5 changes: 5 additions & 0 deletions data-test/db.ldb/LOG.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
2021/11/18-16:03:01.795615 70000b40f000 Recovering log #6
2021/11/18-16:03:01.796437 70000b40f000 Level-0 table #8: started
2021/11/18-16:03:01.797016 70000b40f000 Level-0 table #8: 2609 bytes OK
2021/11/18-16:03:01.799014 70000b40f000 Delete type=0 #6
2021/11/18-16:03:01.799317 70000b40f000 Delete type=3 #4
Binary file added data-test/db.ldb/MANIFEST-000010
Binary file not shown.
4 changes: 2 additions & 2 deletions frontend/src/helpers/attribute-picker.js
Original file line number Diff line number Diff line change
@@ -364,7 +364,7 @@ export class AttributePicker extends LitElement {

get renderDetail() {
return html`
<div id="updateEditor" style="width: 100%;" ?hidden=${this.showDetail}>
<div id="updateEditor" style="width: 100%;" ?hidden=${!this.showDetail}>
<h3><label>Selected label</label></h3>
${
this.schema.category.map((category, idx) => {
@@ -383,7 +383,7 @@ export class AttributePicker extends LitElement {

get renderSimple() {
return html`
<div ?hidden=${!this.showDetail}>
<div ?hidden=${this.showDetail}>
<h3><label>Label for creation</label></h3>
${
this.schema.category.map((category, idx) => {
53 changes: 53 additions & 0 deletions frontend/src/plugins/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* @copyright CEA-LIST/DIASI/SIALV/LVA (2019)
* @author CEA-LIST/DIASI/SIALV/LVA <[email protected]>
* @license CECILL-C
*/

import { LitElement, html } from 'lit-element';
import { setAnnotations } from '../actions/annotations';
import { store, getState, getAnnotations } from '../store';

export class PluginCustom extends LitElement {

/**
* Invoked after the element’s template has been created.
*/
firstUpdated() {
this.dispatchEvent(new Event('ready'));
}

/**
* Invoked when the plugin is launched.
* Trigger display of data from the redux store.
*/
onActivate() {
this.newData();
// Test saving and retrieving annotations
this.saveAnnotations();
this.getAnnotation();
}

/**
* Handle new media to display
*/
newData() {
const media = getState('media');
const path = media.info.path;
console.log('Image path: ', path);
}

saveAnnotations() {
store.dispatch(setAnnotations({annotations: [{stuff: "1"}]}));
}

getAnnotation() {
const annotations = getAnnotations().annotations;
console.log('annotations', annotations);
}

get editor() {
return html`Insert your code`;
}
}
customElements.define('plugin-custom', PluginCustom);
271 changes: 163 additions & 108 deletions frontend/src/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,58 @@
/**
* Summary of plugins for the application:
* You need to add your plugin to the pluginsList in order for
* You need to add your plugin to the pluginsList in order for
* it to be displayed when creating a new annotation task.
* @copyright CEA-LIST/DIASI/SIALV/LVA (2019)
* @author CEA-LIST/DIASI/SIALV/LVA <[email protected]>
* @license CECILL-C
*/
*/

// import {PluginRectangle} from '../plugins/rectangle';

/**
* List of all plugin names
*/
export const pluginsList = [
'rectangle',
'polygon',
'cuboid',
'segmentation',
'tracking',
'keypoints',
'smart-rectangle',
'smart-segmentation',
'smart-tracking',
'sequence-rectangle',
'sequence-cuboid',
'sequence-polygon',
'sequence-keypoints',
'sequence-segmentation'
"rectangle",
"polygon",
"cuboid",
"segmentation",
"tracking",
"keypoints",
"keypoints-atlas",
"smart-rectangle",
"smart-segmentation",
"smart-tracking",
"sequence-rectangle",
"sequence-cuboid",
"sequence-polygon",
"sequence-keypoints",
"sequence-segmentation",
"custom",
];

/**
* Return data input type for each plugin
* @param {String} pluginName
* @param {String} pluginName
*/
export const getDataType = (pluginName) => {

switch (pluginName) {
case 'sequence-keypoints':
case 'sequence-rectangle':
case 'sequence-polygon':
case 'tracking':
case 'smart-tracking':
case 'sequence-segmentation': return 'sequence_image';
case 'sequence-cuboid': return 'sequence_pcl';
case 'cuboid': return 'pcl';
default:
case 'rectangle': return 'image'; // PluginRectangle.dataType;
}
}
switch (pluginName) {
case "sequence-keypoints":
case "sequence-rectangle":
case "sequence-polygon":
case "tracking":
case "smart-tracking":
case "sequence-segmentation":
return "sequence_image";
case "sequence-cuboid":
return "sequence_pcl";
case "cuboid":
return "pcl";
default:
case "rectangle":
return "image"; // PluginRectangle.dataType;
}
};

/**
* Default label schema values for each plugin.
@@ -58,85 +63,135 @@ export const getDataType = (pluginName) => {
* @param {string} pluginName
*/
export const defaultLabelValues = (pluginName) => {
switch(pluginName) {
case 'sequence-segmentation':
case 'smart-segmentation':
case 'segmentation': {
return {
category: [
{name: 'car', color: "green", idx: 1, instance: true},
{name: 'person', color: "#eca0a0", idx: 2, instance: true},
{name: 'road', color: "blue", idx: 3, instance: false}
],
default: 'person'
}
}
case 'smart-rectangle': {
return {
category: [
{name: 'car', color: "green"},
{name: 'person', color: "#eca0a0"},
],
default: 'person'
}
}
case 'smart-tracking':
case 'tracking': {
return {
category: [
{name: 'car', color: "green", properties: []},
{name: 'person', color: "#eca0a0", properties: [
{name: 'posture', type: 'dropdown', enum: ['standing', 'bending', 'sitting', 'lying'],
persistent: false, default: 'standing'}
]},
],
default: 'person'
};
}
switch (pluginName) {
case "sequence-segmentation":
case "smart-segmentation":
case "segmentation": {
return {
category: [
{ name: "car", color: "green", idx: 1, instance: true },
{ name: "person", color: "#eca0a0", idx: 2, instance: true },
{ name: "road", color: "blue", idx: 3, instance: false },
],
default: "person",
};
}
case "smart-rectangle": {
return {
category: [
{ name: "car", color: "green" },
{ name: "person", color: "#eca0a0" },
],
default: "person",
};
}
case "smart-tracking":
case "tracking": {
return {
category: [
{ name: "car", color: "green", properties: [] },
{
name: "person",
color: "#eca0a0",
properties: [
{
name: "posture",
type: "dropdown",
enum: ["standing", "bending", "sitting", "lying"],
persistent: false,
default: "standing",
},
],
},
],
default: "person",
};
}

case 'rectangle':
case 'sequence-rectangle':
default: {
return {
category: [
{
name: 'car', color: "green", properties: [
{name: 'isBlue', type: 'checkbox', default: false}
]
},
{
name: 'person', color: "#eca0a0", properties: [
{name: 'size', type: 'dropdown', enum: ['little', 'big'], default: 'little'}
]
}
],
default: 'person'
}
}
case "rectangle":
case "sequence-rectangle":
default: {
return {
category: [
{
name: "car",
color: "green",
properties: [{ name: "isBlue", type: "checkbox", default: false }],
},
{
name: "person",
color: "#eca0a0",
properties: [
{
name: "size",
type: "dropdown",
enum: ["little", "big"],
default: "little",
},
],
},
],
default: "person",
};
}
}
}
};

export const defaultSettings = (pluginName) => {
switch(pluginName) {
case 'sequence-keypoints':
case 'keypoints': {
return {
radius: 3,
colorFillType: "order",
vertexNames: [
'nose', 'leye','reye','lshoulder','rshoulder','lelbow','relbow','lwrist','rwrist',
'lhip','rhip','lknee','rknee','lankle','rankle','lfoot','rfoot'
],
edges: [[0,1],[0,2],[0,3],[3,4],[3,5],[4,6],[5,7],[6,8],[3,9],[4,10],[10,11],[9,11],[10,12],[11,13],[12,14],[13,15],[14,16]],
edgeColorType: "node"
}
}
case 'smart-segmentation':
return {
model: 'https://raw.githubusercontent.com/pixano/pixano.github.io/master/models/box_model/model.json'
}
default: {
return {}
}
switch (pluginName) {
case "sequence-keypoints":
case "keypoints": {
return {
radius: 3,
colorFillType: "order",
vertexNames: [
"nose",
"leye",
"reye",
"lshoulder",
"rshoulder",
"lelbow",
"relbow",
"lwrist",
"rwrist",
"lhip",
"rhip",
"lknee",
"rknee",
"lankle",
"rankle",
"lfoot",
"rfoot",
],
edges: [
[0, 1],
[0, 2],
[0, 3],
[3, 4],
[3, 5],
[4, 6],
[5, 7],
[6, 8],
[3, 9],
[4, 10],
[10, 11],
[9, 11],
[10, 12],
[11, 13],
[12, 14],
[13, 15],
[14, 16],
],
edgeColorType: "node",
};
}
case "smart-segmentation":
return {
model:
"https://raw.githubusercontent.com/pixano/pixano.github.io/master/models/box_model/model.json",
};
default: {
return {};
}
}
}
};
Loading