Skip to content

djorna/SUN2012-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SUN2012-Python

A Python interface for the SUN2012 dataset.

Dependencies

Build Instructions

Windows

git clone https://github.com/djorna/SUN2012-Python.git
cd SUN2012-Python
py -3 -m virtualenv env && env\Scripts\activate # (Optional) create virtual environment
py -3 -m pip install -r requirements.txt # Install dependencies

Linux/Ubuntu

git clone https://github.com/djorna/SUN2012-Python.git
cd SUN2012-Python
python3-m virtualenv env && source env/bin/activate # (Optional) create virtual environment
python3 -m pip install -r requirements.txt # Install dependencies

Example Usage

from dataloader import SUNLoader
from matplotlib import pyplot as plt

# Initialize SUNLoader object. SUN2012.csv contains metadata from the SUN2012 dataset. 
# groups.json specifies which groups to combine to form supergroups. This can be edited
# to meet specific requirements.
sl = SUNLoader(file_csv='data/SUN2012.csv',
               groups_json='data/groups.json')

# Extract the contents of the tar file to some desired location.
sl.load_SUN2012(filepath='/path/to/download/SUN2012.tar.gz', destination='.')

# Show original image
plt.figure()
plt.imshow(img)
sl.visualize(img, id='sun_acifojkymnniakru', alpha = 0.2)

sun_acifojkymnniakru.png

sun_acifojkymnniakru_label.png

About

A Python interface for the SUN2012 dataset.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages