Skip to content

Load cropped images of houses from the xview2 satellite images and add their damage value as a label.

License

Notifications You must be signed in to change notification settings

intelligenerator/dnet_dataset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dnet_dataset

Pytorch xView2 cropped house and damage value label loader

Table of Contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You will need python3 and pip3 installed on your machine. You can install it from the official website https://www.python.org/.

To install pytorch with CUDA support, conda is recommended. An installation guide is available in the conda docs: https://docs.conda.io/projects/conda/en/latest/user-guide/install/

Initial setup

A step by step series of examples that tell you how to get the project up and running.

Clone the git repository

git clone https://github.com/intelligenerator/dnet_dataset.git
cd dnet_dataset

Then create your conda virtual environment

conda create --name torch
conda activate torch

Next, installed the required packages. This may vary based on your system hardware and requirements. Read more about pytorch installation: https://pytorch.org/get-started/locally/

conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

To exit the virtual environment run

conda deactivate

Happy coding!

Usage

Assuming, you have cloned this repo into the dnet_dataset/ subfolder, you can import it from your project root:

import torch
from dnet_dataset import DamageNetDataset

dataset = DamageNetDataset(images_dir='train/images', labels_dir='train/labels',
                                                    transform=torchvision.transforms.Compose([
                                                        torchvision.transforms.Resize((75, 75)),
                                                        torchvision.transforms.ToTensor()]))

# the dataloader
dataloader = torch.utils.data.DataLoader(dataset, batch_size=64, shuffle=True, num_workers=4)

dataiter = iter(dataloader)
images, labels = next(dataiter)

see test.py

Contributing

Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

About

Load cropped images of houses from the xview2 satellite images and add their damage value as a label.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages