We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#import libraries import json import pandas as pd import matplotlib.pyplot as plt import matplotlib import numpy as np import os from pycocotools.coco import COCO #image loader src_root = 'root folder of dataset in your environment' src_subset = 'subset root of your environment' src_file = src_root + 'train.json' src_desc = 'a name (identifier) for the dataset' coco_obj = COCO(src_file) #data load with open(src_file, 'r') as f: root = json.load(f) root.keys() #dict_keys(['info', 'licenses', 'images', 'categories', 'annotations']) #Basic High level infromation n_images = len(root['images']) n_boxes = len(root['annotations']) n_categ = len(root['categories']) # height, width heights = [x['height'] for x in root['images']] widths = [x['width'] for x in root['images']] print('Dataset Name: ',src_desc) print('Number of images: ',n_images) print('Number of bounding boxes: ', n_boxes) print('Number of classes: ', n_categ) print('Max min avg height: ', max(heights), min(heights), int(sum(heights)/len(heights))) print('Max min avg width: ', max(widths), min(widths), int(sum(widths)/len(widths)))
The text was updated successfully, but these errors were encountered:
Another method over there Coco dataset open for eda #5
Sorry, something went wrong.
sry...
No branches or pull requests
Coco Format parsing for EDA (just paste and use this!)
The text was updated successfully, but these errors were encountered: