a8b94863d2178d84b7e6c66eae38d0964eeca165,examples/instance_segmentation/labelme2coco.py,,main,#,25

Before Change


        out_img_file = osp.join(args.output_dir, "JPEGImages", base + ".jpg")

        img = labelme.utils.img_data_to_arr(label_file.imageData)
        PIL.Image.fromarray(img).convert("RGB").save(out_img_file)
        data["images"].append(
            dict(
                license=0,

After Change


                )
            )

        if not args.noviz:
            labels, captions, masks = zip(
                *[
                    (class_name_to_id[cnm], cnm, msk)
                    for (cnm, gid), msk in masks.items()
                    if cnm in class_name_to_id
                ]
            )
            viz = imgviz.instances2rgb(
                image=img,
                labels=labels,
                masks=masks,
                captions=captions,
                font_size=15,
                line_width=2,
            )
            out_viz_file = osp.join(
                args.output_dir, "Visualization", base + ".jpg"
            )
            imgviz.io.imsave(out_viz_file, viz)

    with open(out_ann_file, "w") as f:
        json.dump(data, f)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: wkentaro/labelme
Commit Name: a8b94863d2178d84b7e6c66eae38d0964eeca165
Time: 2020-07-13
Author: www.kentaro.wada@gmail.com
File Name: examples/instance_segmentation/labelme2coco.py
Class Name:
Method Name: main


Project Name: uber/petastorm
Commit Name: 6e127316edc8118049ca29ff94e2f4c6d34580dc
Time: 2018-07-31
Author: selitvin@users.noreply.github.com
File Name: petastorm/codecs.py
Class Name: CompressedImageCodec
Method Name: encode


Project Name: mathics/Mathics
Commit Name: c73dfb5b97d42ed47aa6e622698bddb7d86377be
Time: 2016-08-16
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/image.py
Class Name: ImageAdjust
Method Name: apply_auto