Skip to content

Commit

Permalink
Fixed issue: Unknown shape type found (cvat-ai#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored and Chris Lee-Messer committed Mar 5, 2020
1 parent 928b729 commit 0e2b262
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions cvat/apps/engine/static/engine/js/shapeCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,17 @@ class ShapeCreatorView {
this._labelSelector.attr('title', `
${shortkeys['change_default_label'].view_value} - ${shortkeys['change_default_label'].description}`);

let labels = window.cvat.labelsInfo.labels();
for (let labelId in labels) {
let option = $(`<option value=${labelId}> ${labels[labelId].normalize()} </option>`);
option.appendTo(this._labelSelector);
const labels = window.cvat.labelsInfo.labels();
const labelsKeys = Object.keys(labels);
for (let i = 0; i < labelsKeys.length; i += 1) {
this._labelSelector.append(
// eslint-disable-next-line
$(`<option value=${labelsKeys[i]}> ${labels[labelsKeys[i]].normalize()} </option>`)
);
}
this._labelSelector.val(labelsKeys[0]);

this._typeSelector.val('box');
this._typeSelector.on('change', (e) => {
// FIXME: In the future we have to make some generic solution
const mode = this._modeSelector.prop('value');
Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/engine/templates/engine/annotation.html
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
<option value="interpolation" class="regular"> Interpolation </option>
</select>
<select id="shapeTypeSelector" class="regular h2">
<option value="box" class="regular"> Box </option>
<option value="box" class="regular" selected> Box </option>
<option value="polygon" class="regular"> Polygon </option>
<option value="polyline" class="regular"> Polyline </option>
<option value="points" class="regular"> Points </option>
Expand Down

0 comments on commit 0e2b262

Please sign in to comment.