• Stars
    star
    177
  • Rank 215,985 (Top 5 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

HugsVision is a easy to use huggingface wrapper for state-of-the-art computer vision

drawing

PyPI version GitHub Issues Contributions welcome License: MIT Downloads

HugsVision is an open-source and easy to use all-in-one huggingface wrapper for computer vision.

The goal is to create a fast, flexible and user-friendly toolkit that can be used to easily develop state-of-the-art computer vision technologies, including systems for Image Classification, Semantic Segmentation, Object Detection, Image Generation, Denoising and much more.

⚠️ HugsVision is currently in beta. ⚠️

Quick installation

HugsVision is constantly evolving. New features, tutorials, and documentation will appear over time. HugsVision can be installed via PyPI to rapidly use the standard library. Moreover, a local installation can be used by those users than want to run experiments and modify/customize the toolkit. HugsVision supports both CPU and GPU computations. For most recipes, however, a GPU is necessary during training. Please note that CUDA must be properly installed to use GPUs.

Anaconda setup

conda create --name HugsVision python=3.6 -y
conda activate HugsVision

More information on managing environments with Anaconda can be found in the conda cheat sheet.

Install via PyPI

Once you have created your Python environment (Python 3.6+) you can simply type:

pip install hugsvision

Install with GitHub

Once you have created your Python environment (Python 3.6+) you can simply type:

git clone https://github.com/qanastek/HugsVision.git
cd HugsVision
pip install -r requirements.txt
pip install --editable .

Any modification made to the hugsvision package will be automatically interpreted as we installed it with the --editable flag.

Example Usage

Let's train a binary classifier that can distinguish people with or without Pneumothorax thanks to their radiography.

Steps:

  1. Move to the recipe directory cd recipes/pneumothorax/binary_classification/
  2. Download the dataset here ~779 MB.
  3. Transform the dataset into a directory based one, thanks to the process.py script.
  4. Train the model: python train_example_vit.py --imgs="./pneumothorax_binary_classification_task_data/" --name="pneumo_model_vit" --epochs=1
  5. Rename <MODEL_PATH>/config.json to <MODEL_PATH>/preprocessor_config.json in my case, the model is situated at the output path like ./out/MYVITMODEL/1_2021-08-10-00-53-58/model/
  6. Make a prediction: python predict.py --img="42.png" --path="./out/MYVITMODEL/1_2021-08-10-00-53-58/model/"

Models recipes

You can find all the currently available models or tasks under the recipes/ folder.

Training a Transformer Image Classifier to help radiologists detect Pneumothorax cases: A demonstration of how to train a Image Classifier Transformer model that can distinguish people with or without Pneumothorax thanks to their radiography with HugsVision.
Training a End-To-End Object Detection with Transformers to detect blood cells: A demonstration of how to train a E2E Object Detection Transformer model which can detect and identify blood cells with HugsVision.
Training a Transformer Image Classifier to help endoscopists: A demonstration of how to train a Image Classifier Transformer model that can help endoscopists to automate detection of various anatomical landmarks, phatological findings or endoscopic procedures in the gastrointestinal tract with HugsVision.
Training and using a TorchVision Image Classifier in 5 min to identify skin cancer: A fast and easy tutorial to train a TorchVision Image Classifier that can help dermatologist in their identification procedures Melanoma cases with HugsVision and HAM10000 dataset.

HuggingFace Spaces

You can try some of the models or tasks on HuggingFace thanks to theirs amazing spaces :

Model architectures

All the model checkpoints provided by 🤗 Transformers and compatible with our tasks can be seamlessly integrated from the huggingface.co model hub where they are uploaded directly by users and organizations.

Before starting implementing, please check if your model has an implementation in PyTorch by refering to this table.

🤗 Transformers currently provides the following architectures for Computer Vision:

  1. ViT (from Google Research, Brain Team) released with the paper An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale, by Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby.
  2. DeiT (from Facebook AI and Sorbonne University) released with the paper Training data-efficient image transformers & distillation through attention by Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, Hervé Jégou.
  3. BEiT (from Microsoft Research) released with the paper BEIT: BERT Pre-Training of Image Transformers by Hangbo Bao, Li Dong and Furu Wei.
  4. DETR (from Facebook AI) released with the paper End-to-End Object Detection with Transformers by Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov and Sergey Zagoruyko.

Build PyPi package

Build: python setup.py sdist bdist_wheel

Upload: twine upload dist/*

Citation

If you want to cite the tool you can use this:

@misc{HugsVision,
  title={HugsVision},
  author={Yanis Labrak},
  publisher={GitHub},
  journal={GitHub repository},
  howpublished={\url{https://github.com/qanastek/HugsVision}},
  year={2021}
}

More Repositories

1

EasyMCDM

Multiple-criteria decision-making (MCDM) with Electre, Promethee, Weighted Sum and Pareto
Python
15
star
2

EasyTTS

Ready-to-use Multilingual Text-To-Speech (TTS) package.
Python
9
star
3

DrBERT

DrBERT: A Robust Pre-trained Model in French for Biomedical and Clinical domains
Python
7
star
4

RichQuizz

Do you like quiz, brain teaser and guessing ? Do you think you know everythings about richs lifestyle ? RichQuizz is the perfect game for you ! Check your knowledge !
TypeScript
4
star
5

ANTILLES

ANTILLES : An Open French Linguistically Enriched Part-of-Speech Corpus
Python
3
star
6

Traveling-Salesman-Problem

This software is an easy to use traveling salesman problem interface which allow you to demonstrate to childrens how the Dijkstra algorithm works.
Java
3
star
7

French-Part-Of-Speech-Tagging

Repository for the source code of the HuggingFace Space named qanastek/French-Part-Of-Speech-Tagging
Python
3
star
8

FrenchLicencePlateDataset

French Licence Plate Dataset annotated with the pascal voc format
Python
3
star
9

WineNot

WineNot is an easy to use app to let you find a wine according to it's label. One step, Just can it !
Dart
2
star
10

Easy-School

A WordPress theme for schools
PHP
2
star
11

CERIcar

A clone of the BlaBlaCar website in Ajax with Doctrine and JQuery
PHP
2
star
12

WinesLabelDataset

Wine label Dataset annotated with the pascal voc format
Python
2
star
13

CineBERT

CineBERT: Transformers based classification system for film review rating prediction
Python
1
star
14

Next-Events

Next Events
PHP
1
star
15

Comedy-Club

A website for a comedy club in Symfony 4
PHP
1
star
16

Pineapple-Monitoring

A web monitoring application for servers clusters in Flask
CSS
1
star
17

EDT-UAPV

Ionic application for the Avignon University time table
TypeScript
1
star
18

EasyPharma

Pharmacy Management System made in JavaFX
Java
1
star
19

ELRC-Medical-V2

ELRC-Medical-V2 : European parallel corpus for healthcare machine translation
Python
1
star
20

DeskMap-V1

Desktop version of map browers such as Google Maps
Java
1
star
21

DeepMusic

DeepMusic is an easy to use Spotify like app to manage and listen to your favorites musics.
Java
1
star
22

qanastek

1
star
23

Arma-3-scripts

Nice scripts for arma 3
SQF
1
star
24

Canteen-Menu

Canteen Menu
PHP
1
star
25

TicTacToe

The TicTacToe game in JavaFX with a multilayer perceptron (MLP)
Java
1
star
26

BAGUETTE

BAGUETTE: Best analysis of Article Given in a UnifiEd approach Through Time Evolution
Python
1
star
27

Retro-Hardware

An Kotlin app to take a look to the Avignon University computer science museum
Kotlin
1
star
28

EasyNotes

An easy to use notes app with folders to manages your ideas and projects (build in Flutter)
Dart
1
star
29

DeskMap

Desktop version of map browser such as Google Maps.
Java
1
star
30

French-Automatic-Number-Plate-Recognition-System

Easy to use receipe to make a French Automatic Number Plate Recognition System (ANPR)
Python
1
star