Package: vizwiz-fewshot
VizWiz-FewShotIntroductionThe VizWiz-FewShot dataset provides nearly 10,000 segmentations of 100 categories on over 4,500 images that were taken by people with visual impairments. These annotations include unique features compared to other datasets, such as holes in objects, a larger range in object size, and significantly more objects containing text. Please read our paper to learn more:VizWiz-FewShot: Locating Objects in Images Taken by People With Visual Impairments.
Yu-Yun Tseng, Alexander Bell, and Danna Gurari. European Conference on Computer Vision (ECCV), 2022.You are in the right place if you are looking for the VizWiz-FewShot API. This API aims to make it as easy as possible to train and evaluate yourobject detectionorinstance segmentationmodel on the VizWiz-FewShot dataset. Read on for more information.Dataset downloadBefore you can use our API, you must download the dataset. Links to download the images and annotations are availablehere.Alternatively, you can run the following series of commands. This will create a directorydatasetwith all the files in your current directory.$ mkdir -p dataset/images dataset/annotations
$ cd dataset
$ wget https://vizwiz.cs.colorado.edu/VizWiz_final/images/train.zip \
       https://vizwiz.cs.colorado.edu/VizWiz_final/images/val.zip \
       https://vizwiz.s3.us-east-2.amazonaws.com/annotations.zip \
       https://vizwiz.s3.us-east-2.amazonaws.com/annotations.json
$ unzip -o train.zip -d images
$ unzip -o val.zip -d images
$ unzip -o annotations.zip -d annotations
$ rm train.zip val.zip annotations.zipAPIInstallationPlease run the following command to install our Python package from PyPI.$ pip install vizwiz-fewshotPyTorch usageWe provide implementations of PyTorch'storch.utils.data.Datasetfor both object detection and instance segmentation. You will supply an instance to atorch.utils.data.DataLoader. To read more about how these work on a deeper level, navigatehere.Note: This assumes you are following the standard4-fold cross-validationapproach for model evaluation used in the few-shot learning community.Object detectionfromvizwizimportObjectDetectionDataset...# Initialize Dataset'sIMAGE_PATH='dataset/images'ANNOTATION_PATH='dataset/annotations.json'# You may need special transforms on the images for your data.# There is no transformation by default. However, here we# transform the images into a `torch.tensor` object.base_dataset=ObjectDetectionDataset(root=IMAGE_PATH,annFile=ANNOTATION_PATH,transform=torchvision.transforms.ToTensor(),fold=0,# Enter the fold here,set_type='base')support_dataset=ObjectDetectionDataset(root=IMAGE_PATH,annFile=ANNOTATION_PATH,transform=torchvision.transforms.ToTensor(),fold=0,set_type='support',shots=1# Enter the number of shots here)query_dataset=ObjectDetectionDataset(root=IMAGE_PATH,annFile=ANNOTATION_PATH,transform=torchvision.transforms.ToTensor(),fold=0,set_type='query')# Initialize DataLoader's. Configure as needed following the PyTorch docs.base_loader=torch.utils.data.DataLoader(base_dataset)support_loader=torch.utils.data.DataLoader(support_dataset)query_loader=torch.utils.data.DataLoader(query_dataset)# Training# Begin by training on the base setfori,datainenumerate(base_loader):...# Fine-tune on the support setfori,datainenumerate(support_loader):...# Evaluate on the query setfori,datainenumerate(query_dataset):......Instance segmentationInstructions will be posted soon.CitationIf you make use of our dataset for your research, please be sure to cite our work with the following BibTeX citation.@misc{https://doi.org/10.48550/arxiv.2207.11810,
  doi = {10.48550/ARXIV.2207.11810},
  url = {https://arxiv.org/abs/2207.11810},
  author = {Tseng, Yu-Yun and Bell, Alexander and Gurari, Danna},
  keywords = {Computer Vision and Pattern Recognition (cs.CV), FOS: Computer and information sciences, FOS: Computer and information sciences},
  title = {VizWiz-FewShot: Locating Objects in Images Taken by People With Visual Impairments},
  publisher = {arXiv},
  year = {2022},
  copyright = {Creative Commons Attribution 4.0 International}
}