GithubHelp home page GithubHelp logo

whuhxb / caco Goto Github PK

View Code? Open in Web Editor NEW

This project forked from utkarshmall13/caco

0.0 0.0 0.0 2.34 MB

official code for CVPR 2023 paper 'Change-Aware Sampling and Contrastive Learning for Satellite Images'

License: MIT License

Shell 0.04% Python 3.15% Jupyter Notebook 96.81%

caco's Introduction

Change-Aware Sampling and Contrastive Learning for Satellite Images

This is the implementation for CVPR 2023 paper Change-Aware Sampling and Contrastive Learning for Satellite Images.

Authors: Utkarsh Mall, Bharath Hariharan, Kavita Bala

CACO

Installation

This codebase is built with and tested with python3.9, and torch 1.7.1. We highly recommend creating environment using anaconda.

conda create --name cacoenv python=3.9.13 -y After activating the environment:

conda activate cacoenv

Install the following packages:

conda install cudatoolkit=11.0 -y

pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 -f https://download.pytorch.org/whl/torch_stable.html

pip install matplotlib pytorch-lightning==1.1.8 pytorch-lightning-bolts==0.3.0 scikit-learn rasterio lmdb pandas

pip installjupyter progressbar opencv-python

Optionally also install

pip install wandb gym

If running into error due to some library mismatch, please refer to requirements.txt for the correct versions.

Quick inference

Use the notebook for quick inference of on our pretrained model.

cd notebooks python -m jupyter notebook --ip 0.0.0.0 --no-browser

The notebook also provides instructions on how to download pretrained models.

The pretrained models can be found at this link

Training

In order to retrain the model, we need to download the CACo data and then run training. A sample training procedure is provided in sample_training.sh

bash sample_training.sh

The data can be found at this link Refer to the sample_training.sh for downloading and placing data.

To train a resnet-18 model with 10k data and caco loss run the following

python3 main_pretrain.py --data_dir ../data/clean_10k_geography/ --base_encoder resnet18 --batch_size 256 --data_mode caco --max_epochs 1000 --schedule 600 800 -d gereric_description

A few more things will be released soon.

  • Code to download custom dataset using CACo sampling.
  • Setup for evaluating on other datasets, BigEarthNet, DynmamicEarthNet, OSCD, and Change Events.
  • 1m training set.

Acknowledgements

This repository follows the stucture from SeCo and uses same versions of libraries used.

caco's People

Contributors

utkarshmall13 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.