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