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

Bounding boxes won't save #78

Open
e-platini opened this issue Nov 18, 2024 · 0 comments
Open

Bounding boxes won't save #78

e-platini opened this issue Nov 18, 2024 · 0 comments

Comments

@e-platini
Copy link

e-platini commented Nov 18, 2024

For the bounding box task. Bounding boxes won't save, and they therefore won't reappear when you open an image again. The save operation is successful but it always saves 0 bounding boxes. This appears to be because the global variable g_targetFrames is not set when working on a bbox task. This prevents bboxes to be saved, because saving loops over g_targetFrames (L298, L322):

def save_annotation(request):
with transaction.atomic():
if request.method != 'POST':
raise Exception('ERROR: Must use POST when saving processed image.')
# Image quality is required
if 'quality' not in request.POST:
raise Exception('ERROR: You must select image quality.')
image_id = int(request.POST['image_id'])
task_id = int(request.POST['task_id'])
new_key_frames = json.loads(request.POST['target_frames'])
rejected = request.POST['rejected'] == 'true'
comments = request.POST['comments']
# Delete old key frames if they exist, this will also delete old annotations
key_frames = KeyFrameAnnotation.objects.filter(image_annotation__task_id=task_id, image_annotation__image_id=image_id)
key_frames.delete()
# Save to DB
try:
annotation = ImageAnnotation.objects.get(task_id=task_id, image_id=image_id)
except ImageAnnotation.DoesNotExist:
annotation = ImageAnnotation()
annotation.image_id = image_id
annotation.task_id = task_id
annotation.rejected = rejected
annotation.comments = comments
annotation.user = request.user
annotation.finished = True
annotation.image_quality = request.POST['quality']
annotation.save()
annotations = []
for frame in new_key_frames:
keyframe = KeyFrameAnnotation()
keyframe.frame_nr = int(frame)
keyframe.image_annotation = annotation
keyframe.save()
annotations.append(keyframe)
return annotations

I'm working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant