Coder Social home page Coder Social logo

fewshotlearningproject's Introduction

DLProject2019

This repository contains clean, readable and tested code for Deep learning course project. The aim is to reproduce few-shot learning methods for food-101, mini_imagenet and omniglot datasets.

This project is written in python 3.6 and assumes you have a GPU.

Food-101

WEBSITE: https://www.vision.ee.ethz.ch/datasets_extra/food-101/

DATASET: http://data.vision.ee.ethz.ch/cvl/food-101.tar.gz

Download food-101.tar.gz and place the extracted files into datasets/food-101 directory as follows:

├── ...
└── datasets 
  └── food-101
     └── meta               
     ├── license_agreement.txt 
     ├── README.txt 
     └── images
        ├── apple_pie
        ├── ...
        └── waffle

Run:

experiment = food101_N5_S5
python3 mainGNN.py --exp_name $experiment --dataset food-101 --test_N_way 5 --train_N_way 5 --train_N_shots 5 --test_N_shots 5 --batch_size 16  --dec_lr=10000  --iterations 80000

Running baseline on food 101 Dataset:

python food101_baseline.py --dest-root <root_folder_to expr_result> --n-epoch <n_epochs> --train-img-dir <root_to_train_images> --test-img-dir <root_to_test_images> --optimizer <name_of_the_optmize_supported_by_keras> --val-img-dir <validaiton_img_root_images>

Runnig Siamese network for classificaiton

python few_shots_classification.py --train-img-dir <root_to_train_images> --test-img-dir <root_to_test_images>

mini_ImageNet

Download: https://drive.google.com/file/d/0B3Irx3uQNoBMQ1FlNXJsZUdYWEE/view,

Place images.zip file inside compressed/mini_imagenet directory:

.
├── ...
└── datasets                    
   └── compressed                
      └── mini_imagenet
         └── images.zip

The images.zip file must contain the splits and images in the following format:

── images.zip
   ├── test.csv                
   ├── train.csv 
   ├── val.csv 
   └── images
      ├── n0153282900000006.jpg
      ├── ...
      └── n1313361300001299.jpg

The splits {test.csv, train.csv, val.csv} are inside datasets/mini_imagenet directory.

Run:

experiment = mini_imagenet_N5_S1
python3 mainGNN.py --exp_name $experiment --dataset mini_imagenet --test_N_way 5 --train_N_way 5 --train_N_shots 1 --test_N_shots 1 --batch_size 16  --dec_lr=10000  --iterations 80000

Omniglot

Download : https://github.com/brendenlake/omniglot/tree/master/python,

Download images_background.zip and images_evaluation.zip files and copy it inside the compressed/omniglot directory:

.
├── ...
└── datasets                    
   └── compressed                
      └── omniglot
         ├── images_background.zip
         └── images_evaluation.zip

Run:

experiment = omniglot_N20_S5
python3 mainGNN.py --exp_name $experiment --dataset omniglot --test_N_way 20 --train_N_way 20 --train_N_shots 5 --test_N_shots 5 --batch_size 16  --dec_lr=10000  --iterations 80000

fewshotlearningproject's People

Watchers

 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.