SavyaSanchi-Sharma
tensorflow_inception_graph
4249ce0
|
Raw
History Blame
1.7 kB

TensorFlow Inception

Image classification with the Inception v1 (GoogLeNet) network trained on ImageNet. The model was originally distributed as a frozen TensorFlow graph (tensorflow_inception_graph.pb) and converted to ONNX for use with OpenCV's DNN module.

Model Details

Usage

Python

python demo.py --model tensorflow_inception_graph_2026jul.onnx --image example_outputs/input_image.png --output example_outputs/output_image.png

Or import directly:

import cv2

net = cv2.dnn.readNet("tensorflow_inception_graph_2026jul.onnx")
# see demo.py for the full inference pipeline

C++

cmake -B build && cmake --build build
./build/demo --model tensorflow_inception_graph_2026jul.onnx --image example_outputs/input_image.png

Conversion

The ONNX model was exported from the frozen TensorFlow graph with tf2onnx (opset 18) via convert_to_onnx.py — inputs input:0, outputs softmax2:0, input shape overridden to [1, 224, 224, 3]. Requires tensorflow, tf2onnx, and onnx.

python convert_to_onnx.py --pb ../pb/tensorflow_inception_graph.pb

License

See LICENSE — the model is released by the TensorFlow Authors under the Apache License 2.0.