"view_id": image_manual's selecting the annotations doesnt work

So we have updated the prodigy to version 1.12.2 and just now I restarted my instance and it worked fine until when I try to select the one wrong line annotation to delete it I am not able to select the line image, not even a single line annotation so the bin button doesn't become black or active.I don't know if that is due to the new version or not but the same issue happens for the same configuration and recipe that worked dine with the older version.

in the configuration we have added two new key value and one update of value of exclude_by from task to input but we tested with the old configuration.json file as well and same issue for that too so in here I have included the new configuration.json

"image_manual_stroke_width": 2,
"image_manual_font_size": 12,
"exclude_by": "input"

configuration.json

{
    "theme": "basic",
    "custom_theme": { "cardMaxWidth": 2000 },
    "buttons": ["accept", "reject", "ignore", "undo"],
    "batch_size": 5,
    "history_size": 10,
    "port": 8060,
    "host": "localhost",
    "cors": true,
    "db": "sqlite",
    "db_settings": {
      "sqlite": {
        "name": "line_segmentation.sqlite",
        "path": "/usr/local/prodigy"
      }
    },
    "validate": true,
    "image_manual_stroke_width": 2,
    "image_manual_font_size": 12,
    "feed_overlap": false,
    "auto_exclude_current": true,
    "instant_submit": true,
    "auto_count_stream": true,
    "total_examples_target": 0,
    "ui_lang": "en",
    "project_info": ["dataset", "session", "lang", "recipe_name", "view_id", "label"],
    "show_stats": false,
    "hide_meta": false,
    "show_flag": false,
    "instructions": false,
    "swipe": false,
    "swipe_gestures": { "left": "accept", "right": "reject" },
    "split_sents_threshold": false,
    "html_template": false,
    "global_css": null,
    "javascript": null,
    "writing_dir": "ltr",
    "show_whitespace": false,
    "exclude_by": "input"
  }

recipe is same, no changes to it with view_id: image_manual. for the input we have a csv file with only the s3_key to the image to be annotated.

import csv
import json
import logging

import prodigy

from tools.config import LAYOUT_ANALYSIS_BUCKET, layout_analysis_s3_client

#s3 config
s3_client = layout_analysis_s3_client
bucket_name = LAYOUT_ANALYSIS_BUCKET

# log config 
logging.basicConfig(
    filename="/usr/local/prodigy/logs/line_segmentation.log",
    format="%(levelname)s: %(message)s",
    level=logging.INFO,
    )

# Prodigy has a logger named "prodigy" according to 
# https://support.prodi.gy/t/how-to-write-log-data-to-file/1427/10
prodigy_logger = logging.getLogger('prodigy')
prodigy_logger.setLevel(logging.INFO)

@prodigy.recipe("line-segmentation-recipe")
def line_segmentation_recipe(dataset, csv_file):
    logging.info(f"dataset:{dataset}, csv_file_path:{csv_file}")
    obj_keys = []
    with open(csv_file) as _file:
        for csv_line in list(csv.reader(_file, delimiter=",")):
            s3_key = csv_line[0]
            # TODO: filter non-image files
            obj_keys.append(s3_key)
    return {
        "dataset": dataset,
        "stream": stream_from_s3(obj_keys),
        "view_id": "image_manual",
        "config": {
            "labels": ["Line"]
        }
    }


def stream_from_s3(obj_keys):
    for obj_key in obj_keys:
        image_url = s3_client.generate_presigned_url(
            ClientMethod="get_object",
            Params={"Bucket": bucket_name, "Key": obj_key},
            ExpiresIn=31536000
        )
        image_id = (obj_key.split("/"))[-1]
        yield {"id": image_id, "image": image_url}

sample demo
536230ac-a25c-4542-996a-e0204aa1235e

That's indeed strange. Thanks for the elaborate ticket. I'll have a look right away and will report back with my findings.

This is a general frontend bug. I just downloaded some images from placeholderkitten and ran this default recipe:

python -m prodigy image.manual issue-6680 ./imgs --label floof,kitty

When I interacted with the interface, I experience the same issue.

CleanShot 2023-07-14 at 15.24.25

I'll try and dive into this some more, but I can confirm this is a bug on our side, probably in our frontend.

thank you, I will be waiting for the bug fix

I can confirm that this issue does not appear in 1.12.0. It seems like it was introduced in v1.12.1 on my end. I'll be working hard to figure out a fix for next week, but in the meantime you might be able to address your issue by downgrading.

if this could be resolved as soon as possible it would be very very helpful as 10 of our annotators are without work for now. we arent going to scale back to 1.12.0 as there are other instances that are running with the current latest version and those might stop or have problem if I re-install the prodigy.

Oh totally! This is the first thing I'll be trying to pick up today and easily the most high priority item on my to-do list now.

1 Like

I have just uninstalled the latest version and installed 1.12.0 on my server and I start running it with only changes to the recipe as below where I have added set_hashes for not to duplicate the same task for annotation or not to repeat.

def stream_from_s3(obj_keys):
    for obj_key in obj_keys:
        eg = {}
        image_url = s3_client.generate_presigned_url(
            ClientMethod="get_object",
            Params={"Bucket": bucket_name, "Key": obj_key},
            ExpiresIn=31536000
        )
        image_id = (obj_key.split("/"))[-1]
        eg = {"id": image_id, "image": image_url}
        yield set_hashes(eg, input_keys=("id"))

and below is the image

we still get the same problem as before where I cant select the annotations

I just did a deep dive and discovered that I was looking at an internal branch name that suggested it was for v1.12, but wasn't. My apologies!

I just triple checked and it seems like this bug was introduced in one of the alpha versions for v1.12. So unfortunately that means that right now v1.11.14 is the most recent version that still works.

Rest asured that I'm on this bug right now though.

I may have found a fix. I'll need to get some folks to review it, but rest assured this is on top of the priority list.

thank you very much, we have so many instances and about 100 of annotators working using the prodigy so it is not good idea to upgrade or downgrade the prodigy too much. it might break the current instances so I would wait for your fix.

Hi @ngawangtrinley, we've just pushed v1.12.3 which should fix this issue. Let us know if you run into any other Frontend bugs here.

Thanks for the detailed report!

sure thanks, I just tried it out and I have found a new bug in here. the selection of the annotations works fine but I am not able to use the polygon or the free hand annotation on the image. And I am using the version 1.12.3 as you advised after the last fix.

below is the gif to show the issue.

fe1439d3-af47-47cd-af47-49b2475103d2

Ah, I hadn't checked the other tools. Will do that right away!

I may have found the bug and a fix. Once again, my colleagues will have to review this but there's a good chance that this issue is gone soon too!

@ngawangtrinley Thanks for your patience here, we just released a new version (v1.12.4) and it should fix your bug with the polygon and freehand tools. Please let us know if you run into any other issues with the image interface.

sure, I will now start using it and will let you know if I find any other issue.

1 Like