Skip to content

Commit

Permalink
Incremental save of annotations (#120)
Browse files Browse the repository at this point in the history
* using shapes id generated by a client
* removed md5.js, code cleanup
* fixed update_paths function; code cleanup;
* fixed import existing tasks without client_id
* added some sanity checks for cleint_id; improved annotation parser logic
* fixed dumping and uploading annotation if annotation task contains interpolation shapes
  • Loading branch information
azhavoro authored and nmanovic committed Oct 15, 2018
1 parent 8600970 commit 7badd24
Show file tree
Hide file tree
Showing 17 changed files with 632 additions and 462 deletions.
6 changes: 5 additions & 1 deletion cvat/apps/dashboard/static/dashboard/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,15 @@ function uploadAnnotationRequest() {
return;
}

const exportData = createExportContainer();
exportData.create = parsed;
exportData.pre_erase = true;

let asyncSave = function() {
$.ajax({
url: '/save/annotation/task/' + window.cvat.dashboard.taskID,
type: 'POST',
data: JSON.stringify(parsed),
data: JSON.stringify(exportData),
contentType: 'application/json',
success: function() {
let message = 'Annotation successfully uploaded';
Expand Down
449 changes: 350 additions & 99 deletions cvat/apps/engine/annotation.py

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions cvat/apps/engine/migrations/0010_auto_20181011_1517.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 2.0.9 on 2018-10-11 12:17

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('engine', '0009_auto_20180917_1424'),
]

operations = [
migrations.AddField(
model_name='labeledbox',
name='client_id',
field=models.BigIntegerField(default=-1),
),
migrations.AddField(
model_name='labeledpoints',
name='client_id',
field=models.BigIntegerField(default=-1),
),
migrations.AddField(
model_name='labeledpolygon',
name='client_id',
field=models.BigIntegerField(default=-1),
),
migrations.AddField(
model_name='labeledpolyline',
name='client_id',
field=models.BigIntegerField(default=-1),
),
migrations.AddField(
model_name='objectpath',
name='client_id',
field=models.BigIntegerField(default=-1),
),
]
1 change: 1 addition & 0 deletions cvat/apps/engine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class Annotation(models.Model):
label = models.ForeignKey(Label, on_delete=models.CASCADE)
frame = models.PositiveIntegerField()
group_id = models.PositiveIntegerField(default=0)
client_id = models.BigIntegerField(default=-1)
class Meta:
abstract = True

Expand Down
280 changes: 0 additions & 280 deletions cvat/apps/engine/static/engine/js/3rdparty/md5.js

This file was deleted.

Loading

0 comments on commit 7badd24

Please sign in to comment.