Giter Site home page Giter Site logo

torch-deephash-dataset's Introduction

Torch DeepHash Dataset

A simple PyTorch implementation of common datasets for Deep Hashing. For now, only NUS-WIDE and COCO datasets are supported.

Installation

Install via pip

pip install git+https://github.com/nghia-ndx/torch-deephash-dataset

Usages

  • Each dataset supports 3 types of splits:
    • train: Train set
    • test: Test set
    • db: Full dataset (exclude train and test)
  • On first __init__, the dataset will be downloaded to the specified root location and will be reused on future runs.
from torch_deephash_dataset.coco import COCODataset
from torch_deephash_dataset.nus_wide import NUSWIDEDataset

coco_dataset = COCODataset('datasets/coco', split='train')
nus_wide_dataset = NUSWIDEDataset('datasets/nus_wide', split='test')
  • Subsequently, if you want to re-download, use force_download=True.

    Note: using force_download=True will DELETE everything in the specified root directory before re-downloading.

from torch_deephash_dataset.nus_wide import NUSWIDEDataset

nus_wide_dataset = NUSWIDEDataset(
    'datasets/nus_wide', 
    split='test', 
    force_download=True
)
  • The dataset could be used with PyTorch's DataLoader as usual:
from torch.utils.data import DataLoader

data_loader = DataLoader(
    dataset=nus_wide_dataset, 
    batch_size=64, 
    num_workers=4
)
  • Data transform and label transform can be appied via transform and target_tranform arguments:
from torch_deephash_dataset.nus_wide import NUSWIDEDataset
from torchvision import transforms

nus_wide_dataset = NUSWIDEDataset(
    'datasets/nus_wide', 
    split='test', 
    transform=transforms.ToTensor()
)

torch-deephash-dataset's People

Contributors

nghia-ndx avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.