Skip to main content

Image classification models for TensorFlow

Project description

Large-scale image classification networks

Collection of large-scale image classification models on TensorFlow, pretrained on the ImageNet-1k dataset.

Installation

To install, use:

pip install tensorflowcv tensorflow-gpu>=1.11.0

To enable/disable different hardware supports, check out TensorFlow installation instructions.

Note that the models use NCHW data format. The current version of TensorFlow cannot work with them on CPU.

Usage

Example of using the pretrained ResNet-18 model:

from tensorflowcv.model_provider import get_model as tfcv_get_model
from tensorflowcv.model_provider import init_variables_from_state_dict as tfcv_init_variables_from_state_dict
import tensorflow as tf
net = tfcv_get_model("resnet18", pretrained=True)
x = tf.placeholder(dtype=tf.float32, shape=(None, 3, 224, 224), name='xx')
y_net = net(x)
with tf.Session() as sess:
    tfcv_init_variables_from_state_dict(sess=sess, state_dict=net.state_dict)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tensorflowcv-0.0.18.tar.gz (40.6 kB view hashes)

Uploaded Source

Built Distribution

tensorflowcv-0.0.18-py2.py3-none-any.whl (85.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page