Package: hugsvision
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 developstate-of-the-artcomputer vision technologies, including systems for Image Classification, Semantic Segmentation, Object Detection, Image Generation, Denoising and much more.⚠️ HugsVision is currently in beta. ⚠️Quick installationHugsVision 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 setupcondacreate--nameHugsVisionpython=3.6-y
condaactivateHugsVisionMore information on managing environments with Anaconda can be found inthe conda cheat sheet.Install via PyPIOnce you have created your Python environment (Python 3.6+) you can simply type:pipinstallhugsvisionInstall with GitHubOnce you have created your Python environment (Python 3.6+) you can simply type:gitclonehttps://github.com/qanastek/HugsVision.gitcdHugsVision
pipinstall-rrequirements.txt
pipinstall--editable.Any modification made to thehugsvisionpackage will be automatically interpreted as we installed it with the--editableflag.Example UsageLet's train a binary classifier that can distinguish people with or withoutPneumothoraxthanks to their radiography.Steps:Move to the recipe directorycd recipes/pneumothorax/binary_classification/Download the datasethere~779 MB.Transform the dataset into a directory based one, thanks to theprocess.pyscript.Train the model:python train_example_vit.py --imgs="./pneumothorax_binary_classification_task_data/" --name="pneumo_model_vit" --epochs=1Rename<MODEL_PATH>/config.jsonto<MODEL_PATH>/preprocessor_config.jsonin my case, the model is situated at the output path like./out/MYVITMODEL/1_2021-08-10-00-53-58/model/Make a prediction:python predict.py --img="42.png" --path="./out/MYVITMODEL/1_2021-08-10-00-53-58/model/"Models recipesYou can find all the currently available models or tasks under therecipes/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 SpacesYou can try some of the models or tasks on HuggingFace thanks to theirs amazing spaces :Model architecturesAll 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 inPyTorchby refering tothis table.🤗 Transformers currently provides the following architectures for Computer Vision:ViT(from Google Research, Brain Team) released with the paperAn 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.DeiT(from Facebook AI and Sorbonne University) released with the paperTraining data-efficient image transformers & distillation through attentionby Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, Hervé Jégou.BEiT(from Microsoft Research) released with the paperBEIT: BERT Pre-Training of Image Transformersby Hangbo Bao, Li Dong and Furu Wei.DETR(from Facebook AI) released with the paperEnd-to-End Object Detection with Transformersby Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov and Sergey Zagoruyko.Build PyPi packageBuild:python setup.py sdist bdist_wheelUpload:twine upload dist/*CitationIf 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}}