Hi,
I want to review the labels of a dataset and remove noisy ones using Prodigy. The dataset comprises robotic surgery videos where each clip has one label describing the presence of tools in four robotic arms. See an example label for a video clip below:
I extracted 120 frames from each video and used the video-level labels to generate labels for the extracted frames. Now here is the problem. It is not necessary that each frame will have the same set of tools present as the video has. Surgeons move out tools temporarily to clear their view. The labels needs correcting for such frames. The following image is an example where two tools are present but the label says three.
I want to create a Prodigy interface with an image item and 4 choice items (one for each robotic arm) to fix these labels. I have the following UI in mind:
Don't know if Prodigy will allow such customisation. I can generate a JSON file for each clip to describe annotated labels which can be used to select the tools by default for each image when rendered in the Prodigy.
I have tried to write the following recipe:
@prodigy.recipe(("data-review-recipe"))
def data_review_recipe(dataset, images_path):
stream = Images(images_path)
tools = [
"needle_driver",
"monopolar_curved_scissor",
"force_bipolar",
"clip_applier",
"tip_up_fenestrated_grasper",
"cadiere_forceps",
"bipolar_forceps",
"vessel_sealer",
"suction_irrigator",
"bipolar_dissector",
"prograsp_forceps",
"stapler",
"permanent_cautery_hook_spatula",
"grasping_retractor",
"nan",
"blank"
]
options=[{"id": i, "text":i} for i in tools]
blocks = [
{"view_id":"image"},
{"view_id":"choices", "options":options}
{"view_id":"choices", "options":options}
{"view_id":"choices", "options":options}
{"view_id":"choices", "options":options}
]
return {
"view_id": "blocks",
"config": {"blocks":blocks},
"dataset": dataset,
"stream": stream,
}
But it is far from what I am trying to achieve. I don't know how to create such UI and then attach options to 4 choice lists for each image which if incorrect can be edited.
Can someone please guide me through this functionality?
I will greatly appreciate your help on this.
Many thanks and
Kind Regards,
Bilal