All Projects → mdietrichstein → Tensorflow Open_nsfw

mdietrichstein / Tensorflow Open_nsfw

Licence: other
Tensorflow Implementation of Yahoo's Open NSFW Model

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Tensorflow Open nsfw

All Classifiers 2019
A collection of computer vision projects for Acute Lymphoblastic Leukemia classification/early detection.
Stars: ✭ 22 (-93.49%)
Mutual labels:  deep-neural-networks, caffe
Androidtensorflowmachinelearningexample
Android TensorFlow MachineLearning Example (Building TensorFlow for Android)
Stars: ✭ 1,369 (+305.03%)
Mutual labels:  deep-neural-networks, tensorflow-models
Nideep
collection of utilities to use with deep learning libraries (e.g. caffe)
Stars: ✭ 25 (-92.6%)
Mutual labels:  deep-neural-networks, caffe
Caffe
Caffe for Sparse and Low-rank Deep Neural Networks
Stars: ✭ 339 (+0.3%)
Mutual labels:  deep-neural-networks, caffe
Caffe2 Ios
Caffe2 on iOS Real-time Demo. Test with Your Own Model and Photos.
Stars: ✭ 221 (-34.62%)
Mutual labels:  deep-neural-networks, caffe
Androidtensorflowmnistexample
Android TensorFlow MachineLearning MNIST Example (Building Model with TensorFlow for Android)
Stars: ✭ 449 (+32.84%)
Mutual labels:  deep-neural-networks, tensorflow-models
Mobilnet ssd opencv
MobilNet-SSD object detection in opencv 3.4.1
Stars: ✭ 64 (-81.07%)
Mutual labels:  deep-neural-networks, caffe
Letslearnai.github.io
Lets Learn AI
Stars: ✭ 33 (-90.24%)
Mutual labels:  deep-neural-networks, tensorflow-models
Snn toolbox
Toolbox for converting analog to spiking neural networks (ANN to SNN), and running them in a spiking neuron simulator.
Stars: ✭ 187 (-44.67%)
Mutual labels:  deep-neural-networks, caffe
Dkeras
Distributed Keras Engine, Make Keras faster with only one line of code.
Stars: ✭ 181 (-46.45%)
Mutual labels:  deep-neural-networks, tensorflow-models
Audio Pretrained Model
A collection of Audio and Speech pre-trained models.
Stars: ✭ 61 (-81.95%)
Mutual labels:  caffe, tensorflow-models
Bmw Tensorflow Inference Api Gpu
This is a repository for an object detection inference API using the Tensorflow framework.
Stars: ✭ 277 (-18.05%)
Mutual labels:  deep-neural-networks, tensorflow-models
Pinto model zoo
A repository that shares tuning results of trained models generated by TensorFlow / Keras. Post-training quantization (Weight Quantization, Integer Quantization, Full Integer Quantization, Float16 Quantization), Quantization-aware training. TensorFlow Lite. OpenVINO. CoreML. TensorFlow.js. TF-TRT. MediaPipe. ONNX. [.tflite,.h5,.pb,saved_model,tfjs,tftrt,mlmodel,.xml/.bin, .onnx]
Stars: ✭ 634 (+87.57%)
Mutual labels:  caffe, tensorflow-models
Ffdl
Fabric for Deep Learning (FfDL, pronounced fiddle) is a Deep Learning Platform offering TensorFlow, Caffe, PyTorch etc. as a Service on Kubernetes
Stars: ✭ 640 (+89.35%)
Mutual labels:  deep-neural-networks, caffe
Awesome Coreml Models
Largest list of models for Core ML (for iOS 11+)
Stars: ✭ 5,192 (+1436.09%)
Mutual labels:  caffe, tensorflow-models
Opentpod
Open Toolkit for Painless Object Detection
Stars: ✭ 106 (-68.64%)
Mutual labels:  deep-neural-networks, tensorflow-models
Deep Learning In Production
In this repository, I will share some useful notes and references about deploying deep learning-based models in production.
Stars: ✭ 3,104 (+818.34%)
Mutual labels:  deep-neural-networks, tensorflow-models
Cascaded Fcn
Source code for the MICCAI 2016 Paper "Automatic Liver and Lesion Segmentation in CT Using Cascaded Fully Convolutional NeuralNetworks and 3D Conditional Random Fields"
Stars: ✭ 296 (-12.43%)
Mutual labels:  deep-neural-networks, caffe
Caffe Mobile
Optimized (for size and speed) Caffe lib for iOS and Android with out-of-the-box demo APP.
Stars: ✭ 316 (-6.51%)
Mutual labels:  caffe
Learning
The data is the future of oil, digging the potential value of the data is very meaningful. This library records my road of machine learning study.
Stars: ✭ 330 (-2.37%)
Mutual labels:  caffe

Tensorflow Implementation of Yahoo's Open NSFW Model

This repository contains an implementation of Yahoo's Open NSFW Classifier rewritten in tensorflow.

The original caffe weights have been extracted using Caffe to TensorFlow. You can find them at data/open_nsfw-weights.npy.

Prerequisites

All code should be compatible with Python 3.6 and Tensorflow 1.x (tested with 1.12). The model implementation can be found in model.py.

Usage

> python classify_nsfw.py -m data/open_nsfw-weights.npy test.jpg

Results for 'test.jpg'
	SFW score:	0.9355766177177429
	NSFW score:	0.06442338228225708

Note: Currently only jpeg images are supported.

classify_nsfw.py accepts some optional parameters you may want to play around with:

usage: classify_nsfw.py [-h] -m MODEL_WEIGHTS [-l {yahoo,tensorflow}]
                        [-t {tensor,base64_jpeg}]
                        input_jpeg_file

positional arguments:
  input_file            Path to the input image. Only jpeg images are
                        supported.

optional arguments:
  -h, --help            show this help message and exit
  -m MODEL_WEIGHTS, --model_weights MODEL_WEIGHTS
                        Path to trained model weights file
  -l {yahoo,tensorflow}, --image_loader {yahoo,tensorflow}
                        image loading mechanism
  -i {tensor,base64_jpeg}, --input_type {tensor,base64_jpeg}
                        input type

-l/--image-loader

The classification tool supports two different image loading mechanisms.

  • yahoo (default) replicates yahoo's original image loading and preprocessing. Use this option if you want the same results as with the original implementation
  • tensorflow is an image loader which uses tensorflow exclusively (no dependencies on PIL, skimage, etc.). Tries to replicate the image loading mechanism used by the original caffe implementation, differs a bit though due to different jpeg and resizing implementations. See this issue for details.

Note: Classification results may vary depending on the selected image loader!

-i/--input_type

Determines if the model internally uses a float tensor (tensor - [None, 224, 224, 3] - default) or a base64 encoded string tensor (base64_jpeg - [None, ]) as input. If base64_jpeg is used, then the tensorflow image loader will be used, regardless of the -l/--image-loader argument.

Tools

The tools folder contains some utility scripts to test the model.

create_predict_request.py

Takes an input image and generates a json file suitable for prediction requests to a Open NSFW Model deployed with Google Cloud ML Engine (gcloud ml-engine predict) or tensorflow-serving.

export_savedmodel.py

Exports the model using the tensorflow serving export api (SavedModel). The export can be used to deploy the model on Google Cloud ML Engine, Tensorflow Serving or on mobile (haven't tried that one yet).

export_tflite.py

Exports the model in TFLite format. Use this one if you want to run inference on mobile or IoT devices. Please note that the base64_jpeg input type does not work with TFLite since the standard runtime lacks a number of required tensorflow operations.

export_graph.py

Exports the tensorflow graph and checkpoint. Freezes and optimizes the graph per default for improved inference and deployment usage (e.g. Android, iOS, etc.). Import the graph with tf.import_graph_def.

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].