Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View dataset with fiftyone #2

Open
robmarkcole opened this issue Oct 17, 2022 · 0 comments
Open

View dataset with fiftyone #2

robmarkcole opened this issue Oct 17, 2022 · 0 comments

Comments

@robmarkcole
Copy link

Just a little tip, but fiftyone can be used to view the dataset - just required updating the annotation file slightly:

import json
import fiftyone as fo

annots = json.load(open("dataset/SateAirports/annotations.json"))

def update_filename_to_png(annots: dict):
    for image in annots['images']:
        image['file_name'] = image['file_name'].replace('tif','png')
    return annots

annots_png = update_filename_to_png(annots)
json.dump(annots_png, open("dataset/SateAirports/annotations_png.json", 'w'))

coco_dataset = fo.Dataset.from_dir(
    dataset_type=fo.types.COCODetectionDataset,
    data_path='dataset/SateAirports/PNGImages',
    labels_path="dataset/SateAirports/annotations_png.json",
    include_id=True,
)

session = fo.launch_app(coco_dataset)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant