Home

Awesome

Neural Network Libraries - Examples

This repository contains working examples of Neural Network Libraries. Before running any of the examples in this repository, you must install the Python package for Neural Network Libraries. The Python install guide can be found here.

Before running an example, also run the following command inside the example directory, to install additional dependencies:

cd example_directory
pip install -r requirements.txt

Docker workflow

nnabla-examples-utils (neu)

neu can now be installed as a python package. It provides a wide range of utility functions. For installation and usage, check utils

Interactive Demos

We have prepared interactive demos, where you can play around without having to worry about the codes and the internal mechanism. You can run it directly on Colab from the links in the table below.

Vision: Generation, Enhancement, Animation

NameNotebookTaskExample
SLE-GANOpen In ColabImage Generation<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/image-generation/slegan/example.png" align="center" height="90" ></a>
First Order Motion ModelOpen In ColabFacial Motion Transfer<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/facial-motion-transfer/first-order-model/imgs/sample_fake.gif" align="center" height="90" ></a>
Zooming Slow-MoOpen In ColabVideo Super-Resolution<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/frame-interpolation/zooming-slow-mo/demo/original.gif" align="center" height="90"></a> <a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/frame-interpolation/zooming-slow-mo/demo/zooming_slomo.gif" align="center" height="90" ></a>
StyleGAN2Open In ColabImage Generation<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/image-generation/stylegan2/images/sample.png" align="center" height="90" ></a>
Deep-Exemplar-based-Video-ColorizationOpen In ColabVideo Colorization<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/video-colorization/deep-exemplar-based-video-colorization/images/examples/mov1.gif" align="center" height="90"></a> <a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/video-colorization/deep-exemplar-based-video-colorization/images/examples/out1.gif" align="center" height="90" ></a>
TecoGANOpen In ColabVideo Super-Resolution<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/video-superresolution/tecogan/results/cropped_lr_city.gif" align="center" height="90"></a> <a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/video-superresolution/tecogan/results/cropped_sr_city.gif" align="center" height="90" ></a>
ESR-GANOpen In ColabSuper-Resolution<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/image-superresolution/esrgan/results/comic.png" align="center" height="90"></a> <a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/image-superresolution/esrgan/results/comic_SR.png" align="center" height="90" ></a>
Self-Attention GANOpen In ColabImage Generation<a href="url"><img src="https://camo.githubusercontent.com/afa86e7d0ccdb2ba75c273070f8dc8d50bda5d2821ebacbf1fc40a2dc0059b7c/68747470733a2f2f626c6f672e6e6e61626c612e6f72672f77702d636f6e74656e742f75706c6f6164732f323031382f31322f30343131303033342f3030303938352d333030783330302e706e67" align="center" height="90" ></a> <a href="url"><img src="https://camo.githubusercontent.com/9f829b60f2b53bfb77111f55997e6ed0f160f8b04437c046754a32503f90a1ba/68747470733a2f2f626c6f672e6e6e61626c612e6f72672f77702d636f6e74656e742f75706c6f6164732f323031382f31322f30343131303034322f3030303933332d333030783330302e706e67" align="center" height="90" ></a>
StarGANOpen In ColabImage Translation<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/image-translation/stargan/imgs/sample_black_haired_female.png" align="center" height="90" ></a><a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/image-translation/stargan/imgs/sample_blond_haired_female.png" align="center" height="90" ></a>
DCGANOpen In ColabImage Generation

Vision & Language

NameNotebookTaskExample
CLIPOpen In ColabZero-shot image classification<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/vision-and-language/clip/CLIP.png" align="center" height="90" ></a>

Vision: Recognition

NameNotebookTaskExample
CenterNetOpen In ColabObject Detection<a href="url"><img src="https://blog.nnabla.org/wp-content/uploads/sites/2/2021/02/02093255/centernet_result_resized.jpg" align="center" height="90" ></a>
PSMNetOpen In ColabStereo Depth Estimation<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/stereo-depth/PSMnet/results/0006.png" align="center" height="90" ></a> <a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/stereo-depth/PSMnet/results/depth_sceneflow.png" align="center" height="90"></a>
Face Alignment NetworkOpen In ColabFacial Keypoint Detection<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/facial-keypoint-detection/face-alignment/results/example1.png" align="center" height="90" ></a><a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/facial-keypoint-detection/face-alignment/results/example2.png" align="center" height="90" ></a>
YOLO v2Open In ColabObject Detection
ResNet/ResNeXt/SENetOpen In ColabImage Classification<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/image-classification/imagenet/results/rn50-mp-cos90-loss.png" align="center" height="90" ></a>

Audio

NameNotebookTaskExample
D3NetOpen In ColabMusic Source Separation
X-UMXOpen In ColabMusic Source Separation<a href="url"><img src="https://github.com/sony/ai-research-code/raw/master/x-umx/imgs/umx-network-vs-x-umx-network.png" align="center" height="90" ></a>

Machine Learning

NameNotebookTaskExample
Out-of-Core trainingOpen In ColabOut-of-Core training<a href="url"><img src="https://github.com/sony/ai-research-code/blob/master/out-of-core-training/imgs/overview.png?raw=true" align="center" height="90" ></a>
MixUp / CutMix / VH-MixupOpen In ColabData Augmentation<a href="url"><img src="https://blog.nnabla.org/wp-content/uploads/sites/2/2020/04/07131002/mixuped_img.png" align="center" height="90" ></a> <a href="url"><img src="https://blog.nnabla.org/wp-content/uploads/sites/2/2020/04/07131130/cutmixed_img.png" align="center" height="90" ></a>
Virtual Adversarial TrainingOpen In ColabSemi-Supervised Learning
SiameseNetOpen In ColabFeature Embedding
Variational Auto-encoderOpen In ColabUnsupervised Learning

eXplainable AI

NameNotebookTaskExample
Grad-CAMOpen In ColabVisualization<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/responsible_ai/gradcam/images/sample.png" align="center" height="90" ></a>
SHAPOpen In ColabVisualization<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/responsible_ai/shap/images/sample.png" align="center" height="90" ></a>
Attention Branch NetworkOpen In ColabVisualization<a href="url"><img src="responsible_ai/attention_branch_network/images/attention_branch_network.png" align="center" height="90" ></a>

Fairness of Machine Learning

NameNotebookTaskExample
Demographic parity <br> Disparate Impact <br> Equal opportunity <br> Equalised oddsOpen In Colab[Metrics tutorial] <br> Dataset/Model Bias Check<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/responsible_ai/fairness_metrics/images/fairness_metrics.PNG" align="center" height="90" ></a>
ReweighingOpen In Colab[Pre-processing tutorial] <br> Dataset/Model Bias Check and Mitigation by Reweighing<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/responsible_ai/gender_bias_mitigation/images/fairness.png" align="center" height="90" ></a>
Massage DataOpen In Colab[Pre-processing tutorial] <br> Dataset/Model Bias Check and Mitigation by Massage Data<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/responsible_ai/massage_data/images/massage_data_workflow_diagram.png" align="center" height="90" ></a>
Preferential SamplingOpen In Colab[Pre-processing tutorial] <br> Dataset/Model Bias Check and Mitigation by Preferential Sampling<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/responsible_ai/preferential_sampling/images/preferential_sampling_workflow_diagram.png" align="center" height="90" ></a>
GAN Data DebiasingOpen In Colab[Pre-processing tutorial] <br> Dataset/Model Bias Check and Mitigation by GAN<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/responsible_ai/gan_data_debiased/images/gan_data_debiasing_workflow.png" align="center" height="90" ></a>
Prejudice Remover RegularizerOpen In Colab[In-processing tutorial] <br> Model Bias Check and Mitigation by Prejudice Removal Technique<a href="url"><img src="https://github.com/sony/nnabla-examples/blob/master/responsible_ai/prejudice_remover_regularizer/images/Prejudice_Remover_Regularizer_Equation.png" align="center" height="90" ></a>
Prejudice Remover Regularizer for ImagesOpen In Colab[In-processing tutorial] <br> Model Bias Check and Mitigation by Prejudice Removal Technique for Images<a href="url"><img src="https://github.com/sony/nnabla-examples/blob/master/responsible_ai/prejudice_remover_regularizer_images/images/Prejudice_Remover_Regularizer_Equation.png" align="center" height="90" ></a>
Adversarial Debiasing TutorialOpen In Colab[In-processing tutorial] <br> Model Bias Check and Mitigation by Adversarial Debiasing<a href="url"><img src="https://github.com/sony/nnabla-examples/blob/master/responsible_ai/adversarial_debiasing/images/adversarial_debiasing_training.png" align="center" height="90" ></a>
Adversarial Debiasing for ImagesOpen In Colab[In-processing tutorial] <br> Model Bias Check and Mitigation by Adversarial Debiasing for Images<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/responsible_ai/adversarial_debiasing_images/images/adversarial_debiasing_workflow_diagram.png" align="center" height="90" ></a>
Rejection Option based ClassificationOpen In Colab[Post-processing tutorial] <br> Prediction Bias Check and Mitigation by ROC<a href="url"><img src="https://github.com/sony/nnabla-examples/blob/master/responsible_ai/rejection_option_based_classification/images/roc.png" align="center" height="90" ></a>
Rejection Option based Classification for ImagesOpen In Colab[Post-processing tutorial] <br> Prediction Bias Check and Mitigation by ROC for Images<a href="url"><img src="https://github.com/sony/nnabla-examples/blob/master/responsible_ai/rejection_option_based_classification_images/images/roc_workflow_diagram.png" align="center" height="90" ></a>
Skin color (Masked Images)Open In ColabFacial evaluation for skin color<a href="url"><img src="https://github.com/sony/nnabla-examples/raw/master/responsible_ai/face_evaluation/Masked_Images.png" align="center" height="90" ></a>

Model Quantization

NameNotebookTaskExample
Post-training quantizationOpen In ColabPost-training quantization