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

Incremental save of annotation. #120

Merged
merged 13 commits into from
Oct 15, 2018
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
490 changes: 403 additions & 87 deletions cvat/apps/engine/annotation.py

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions cvat/apps/engine/migrations/0010_auto_20181002_1122.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Generated by Django 2.0.3 on 2018-10-02 08:22

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.IntegerField(default=-1),
),
migrations.AddField(
model_name='labeledpoints',
name='client_id',
field=models.IntegerField(default=-1),
),
migrations.AddField(
model_name='labeledpolygon',
name='client_id',
field=models.IntegerField(default=-1),
),
migrations.AddField(
model_name='labeledpolyline',
name='client_id',
field=models.IntegerField(default=-1),
),
migrations.AddField(
model_name='objectpath',
name='client_id',
field=models.IntegerField(default=-1),
),
migrations.AddField(
model_name='trackedbox',
name='client_id',
field=models.IntegerField(default=-1),
),
migrations.AddField(
model_name='trackedpoints',
name='client_id',
field=models.IntegerField(default=-1),
),
migrations.AddField(
model_name='trackedpolygon',
name='client_id',
field=models.IntegerField(default=-1),
),
migrations.AddField(
model_name='trackedpolyline',
name='client_id',
field=models.IntegerField(default=-1),
),
]
2 changes: 2 additions & 0 deletions cvat/apps/engine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class Meta:
class Shape(models.Model):
occluded = models.BooleanField(default=False)
z_order = models.IntegerField(default=0)
client_id = models.IntegerField(default=-1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better add client_id into Annotation class instead of Shape and ObjectPath

class Meta:
abstract = True

Expand Down Expand Up @@ -189,6 +190,7 @@ class LabeledPointsAttributeVal(AttributeVal):

class ObjectPath(Annotation):
id = models.BigAutoField(primary_key=True)
client_id = models.IntegerField(default=-1)
shapes = models.CharField(max_length=10, default='boxes')

class ObjectPathAttributeVal(AttributeVal):
Expand Down
280 changes: 0 additions & 280 deletions cvat/apps/engine/static/engine/js/3rdparty/md5.js

This file was deleted.

Loading