All Projects → avilash → pytorch-siamese-triplet

avilash / pytorch-siamese-triplet

Licence: other
One-Shot Learning with Triplet CNNs in Pytorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pytorch-siamese-triplet

EfficientWord-Net
OneShot Learning-based hotword detection.
Stars: ✭ 78 (+5.41%)
Mutual labels:  one-shot-learning, siamese-network
gans-2.0
Generative Adversarial Networks in TensorFlow 2.0
Stars: ✭ 76 (+2.7%)
Mutual labels:  mnist, fashionmnist
FSL-Mate
FSL-Mate: A collection of resources for few-shot learning (FSL).
Stars: ✭ 1,346 (+1718.92%)
Mutual labels:  one-shot-learning, meta-learning
One-Shot-Learning-with-Siamese-Networks
Implementation of One Shot Learning using Convolutional Siamese Networks on Omniglot Dataset
Stars: ✭ 129 (+74.32%)
Mutual labels:  one-shot-learning, siamese-network
one-shot-steel-surfaces
One-Shot Recognition of Manufacturing Defects in Steel Surfaces
Stars: ✭ 29 (-60.81%)
Mutual labels:  one-shot-learning, siamese-network
Facial-Recognition-Using-FaceNet-Siamese-One-Shot-Learning
Implementation of Facial Recognition System Using Facenet based on One Shot Learning Using Siamese Networks
Stars: ✭ 104 (+40.54%)
Mutual labels:  one-shot-learning, siamese-network
Meta Learning Papers
Meta Learning / Learning to Learn / One Shot Learning / Few Shot Learning
Stars: ✭ 2,420 (+3170.27%)
Mutual labels:  one-shot-learning, meta-learning
TorchBlocks
A PyTorch-based toolkit for natural language processing
Stars: ✭ 85 (+14.86%)
Mutual labels:  triplet-loss, siamese-network
Deep-One-Shot-Logo-Retrieval
A Deep One-Shot Network for Query-based Logo Retrieval [Pattern Recognition 2019, Elsevier]
Stars: ✭ 58 (-21.62%)
Mutual labels:  one-shot-learning, siamese-network
Multidigitmnist
Combine multiple MNIST digits to create datasets with 100/1000 classes for few-shot learning/meta-learning
Stars: ✭ 48 (-35.14%)
Mutual labels:  mnist, meta-learning
Siamese Triplet
Siamese and triplet networks with online pair/triplet mining in PyTorch
Stars: ✭ 2,564 (+3364.86%)
Mutual labels:  triplet-loss, siamese-network
oneshot-audio
Experiment with "one-shot learning" techniques to recognize a voice signature
Stars: ✭ 22 (-70.27%)
Mutual labels:  one-shot-learning, siamese-network
finetuner
Finetuning any DNN for better embedding on neural search tasks
Stars: ✭ 442 (+497.3%)
Mutual labels:  triplet-loss, siamese-network
Nearest-Celebrity-Face
Tensorflow Implementation of FaceNet: A Unified Embedding for Face Recognition and Clustering to find the celebrity whose face matches the closest to yours.
Stars: ✭ 30 (-59.46%)
Mutual labels:  one-shot-learning, meta-learning
image triplet loss
Image similarity using Triplet Loss
Stars: ✭ 76 (+2.7%)
Mutual labels:  triplet-loss, siamese-network
Offline-Signature-Verification-using-Siamese-Network
Identifying forged signatures using convolutional siamese networks implemented in Keras
Stars: ✭ 31 (-58.11%)
Mutual labels:  one-shot-learning, siamese-network
SiamFC-tf
A TensorFlow implementation of the SiamFC tracker, use with your own camera and video, or integrate to your own project 实时物体追踪,封装API,可整合到自己的项目中
Stars: ✭ 22 (-70.27%)
Mutual labels:  siamese, siamese-network
Signature-verification-using-deep-learning
Using SigComp'11 dataset for signature verification
Stars: ✭ 54 (-27.03%)
Mutual labels:  triplet-loss, siamese-network
keras-triplet-center-loss
Simple Keras implementation of Triplet-Center Loss on the MNIST dataset
Stars: ✭ 34 (-54.05%)
Mutual labels:  mnist, triplet-loss
awesome-few-shot-meta-learning
awesome few shot / meta learning papers
Stars: ✭ 44 (-40.54%)
Mutual labels:  one-shot-learning, meta-learning

Deep metric learning using Triplet network in PyTorch

The following repository contains code for training Triplet Network in Pytorch
Siamese and Triplet networks make use of a similarity metric with the aim of bringing similar images closer in the embedding space while separating non similar ones.
Popular uses of such networks being -

  • Face Verification / Classification
  • Learning deep embeddings for other tasks like classification / detection / segmentation

Paper - Deep metric learning using Triplet network

Installation

Install PyTorch

pip install -r requirements.txt  

Demo

Colab notebook with pretrained weights

Training

python train.py --cuda  

This by default will train on the MNIST dataset

MNIST / FashionMNIST

python train.py --result_dir results --exp_name MNIST_exp1 --cuda --dataset <manist>/<fmnist>  

To create a tSNE visualisation

python tsne.py --ckp <path to model>  

The embeddings and the labels are stored in the experiment folder as a pickle file, and you do not have to run the model everytime you create a visualisation. Just pass the saved embeddings as the --pkl parameter

python tsne.py --pkl <path to stored embeddings>  

Sample tSNE visualisation on MNIST tSNE

VGGFace2

Specify the location of the dataset in test.yaml
The directory should have the following structure

+-- root
|   +-- train
|       +-- class1
|           +-- img1.jpg
|           +-- img2.jpg
|           +-- img3.jpg
|       +-- class2
|       +-- class3
|   +-- test
|       +-- class4
|       +-- class5
python train.py --result_dir results --exp_name VGGFace2_exp1 --cuda --epochs 50 --ckp_freq 5 --dataset vggface2 --num_train_samples 32000 --num_test_samples 5000 --train_log_step 50 

Custom Dataset

Specify the location of the dataset in test.yaml
The directory should have the following structure

+-- root
|   +-- train
|       +-- class1
|           +-- img1.jpg
|           +-- img2.jpg
|           +-- img3.jpg
|       +-- class2
|       +-- class3
|   +-- test
|       +-- class4
|       +-- class5
python train.py --result_dir results --exp_name Custom_exp1 --cuda --epochs 50 --ckp_freq 5 --dataset custom --num_train_samples 32000 --num_test_samples 5000 --train_log_step 50 

TODO

  • Train on MNIST / FashionMNIST
  • Train on a public dataset
  • Multi GPU Training
  • Custom Dataset
  • Include popular models - ResneXT / Resnet / VGG / Inception
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].