Jimut123 / cellseg

Code for the paper titled "Advancing instance segmentation and WBC classification in peripheral blood smear through domain adaptation: A study on PBC and the novel RV-PBS datasets" published on Elsevier's Expert Systems With Applications (ESWA) journal.
https://www.sciencedirect.com/science/article/pii/S0957417424005268
0 stars 0 forks source link

Script for generating masks #16

Closed heraldofsolace closed 3 years ago

heraldofsolace commented 3 years ago

How to run

The script is in the Aniket_Mask_RCNN folder. Use dvc pull to get the h5 file. Put the script and the h5 file in the same folder (containing the Mask RCNN library folder). Put all the images in a directory and put the directory where the script is located. Then run mask_rcnn4_generate_json.py directory_where_the_images_are. Make sure the directory only contains images.

The output will be in directory_where_the_images_are/results.json in the following format -

{ "data": {
    "0": {
           "filename": "Image name",
           "height": image_height,
           "width": image_width,
           "masks": [ { "class_name": "detected_class",
                                 "score": confidence_score, 
                                 "bounding_box": { "x1": x1, "x2": x2, "y1": y1, "y2": y2 },
                                 "vertices": [ [ x, y ], [ x, y ], ... ] } ]
    },
"1": { ... }
}