Skip to content

Commit 9418356

Browse files
committed
Fix missing images
1 parent c66757b commit 9418356

File tree

111 files changed

+3148
-2794
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+3148
-2794
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 12ae803fbc9b69a8e785b52f812c9afd
3+
config: 71ee4cae48b6d2f290dbbba66f289314
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
34.9 KB
Binary file not shown.

docs/build/.doctrees/index.doctree

13.6 KB
Binary file not shown.

docs/build/.doctrees/install.doctree

175 KB
Binary file not shown.

docs/build/.doctrees/issues.doctree

22.8 KB
Binary file not shown.

docs/build/.doctrees/training.doctree

178 KB
Binary file not shown.
Loading
Loading

docs/build/html/_sources/camera.rst.txt renamed to docs/build/_sources/camera.rst.txt

+16-13
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Detect Objects Using Your Webcam
33

44
Hereby you can find an example which allows you to use your camera to generate a video stream, based on which you can perform object_detection.
55

6+
To run the example, simply create a new file under ``<PATH_TO_TF>/TensorFlow/models/research/object_detection`` and paste the code below.
7+
68
.. code-block:: python
79
810
import numpy as np
@@ -18,8 +20,8 @@ Hereby you can find an example which allows you to use your camera to generate a
1820
from io import StringIO
1921
from matplotlib import pyplot as plt
2022
from PIL import Image
21-
from utils import label_map_util
22-
from utils import visualization_utils as vis_util
23+
from object_detection.utils import label_map_util
24+
from object_detection.utils import visualization_utils as vis_util
2325
2426
# Define the video stream
2527
cap = cv2.VideoCapture(0) # Change only if you have more than one webcams
@@ -40,20 +42,22 @@ Hereby you can find an example which allows you to use your camera to generate a
4042
NUM_CLASSES = 90
4143
4244
# Download Model
43-
opener = urllib.request.URLopener()
44-
opener.retrieve(DOWNLOAD_BASE + MODEL_FILE, MODEL_FILE)
45-
tar_file = tarfile.open(MODEL_FILE)
46-
for file in tar_file.getmembers():
47-
file_name = os.path.basename(file.name)
48-
if 'frozen_inference_graph.pb' in file_name:
49-
tar_file.extract(file, os.getcwd())
45+
if not os.path.exists(os.path.join(os.getcwd(), MODEL_FILE)):
46+
print("Downloading model")
47+
opener = urllib.request.URLopener()
48+
opener.retrieve(DOWNLOAD_BASE + MODEL_FILE, MODEL_FILE)
49+
tar_file = tarfile.open(MODEL_FILE)
50+
for file in tar_file.getmembers():
51+
file_name = os.path.basename(file.name)
52+
if 'frozen_inference_graph.pb' in file_name:
53+
tar_file.extract(file, os.getcwd())
5054
5155
5256
# Load a (frozen) Tensorflow model into memory.
5357
detection_graph = tf.Graph()
5458
with detection_graph.as_default():
55-
od_graph_def = tf.GraphDef()
56-
with tf.gfile.GFile(PATH_TO_CKPT, 'rb') as fid:
59+
od_graph_def = tf.compat.v1.GraphDef()
60+
with tf.io.gfile.GFile(PATH_TO_CKPT, 'rb') as fid:
5761
serialized_graph = fid.read()
5862
od_graph_def.ParseFromString(serialized_graph)
5963
tf.import_graph_def(od_graph_def, name='')
@@ -76,9 +80,8 @@ Hereby you can find an example which allows you to use your camera to generate a
7680
7781
# Detection
7882
with detection_graph.as_default():
79-
with tf.Session(graph=detection_graph) as sess:
83+
with tf.compat.v1.Session(graph=detection_graph) as sess:
8084
while True:
81-
8285
# Read frame from camera
8386
ret, image_np = cap.read()
8487
# Expand dimensions since the model expects images to have shape: [1, None, None, 3]

docs/build/html/_sources/index.rst.txt renamed to docs/build/_sources/index.rst.txt

+13-7
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,34 @@
66
TensorFlow Object Detection API tutorial
77
============================================
88

9+
.. important:: This tutorial is intended for TensorFlow 1.14, which (at the time of writing this tutorial) is the latest stable version before TensorFlow 2.x.
10+
11+
Tensorflow 1.15 has also been released, but seems to be exhibiting `instability issues <https://github.com/tensorflow/models/issues/7640>`_.
12+
13+
A version for TensorFlow 1.9 can be found `here <https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/v1.9.1/>`_.
14+
15+
At the time of righting this tutorial, Object Detection model training and evaluation was not migrated to TensorFlow 2.x (see `here <https://github.com/tensorflow/models/issues/6423#issuecomment-600925072>`_). From personal tests, it seems that detection using pre-trained models works, however it is not yet possible to train and evaluate models. Once the migration has been completed, a version for TensorFlow 2.x will be produced.
16+
917
This is a step-by-step tutorial/guide to setting up and using TensorFlow's Object Detection API to perform, namely, object detection in images/video.
1018

1119
The software tools which we shall use throughout this tutorial are listed in the table below:
1220

1321
+---------------------------------------------+
1422
| Target Software versions |
1523
+==============+==============================+
16-
| OS | Windows, Linux [*]_ |
24+
| OS | Windows, Linux |
1725
+--------------+------------------------------+
18-
| Python | 3.6 |
26+
| Python | 3.7 |
1927
+--------------+------------------------------+
20-
| TensorFlow | 1.9 |
28+
| TensorFlow | 1.14 |
2129
+--------------+------------------------------+
22-
| CUDA Toolkit | v9.0 |
30+
| CUDA Toolkit | 10.0 |
2331
+--------------+------------------------------+
24-
| CuDNN | v7.0.5 |
32+
| CuDNN | 7.6.5 |
2533
+--------------+------------------------------+
2634
| Anaconda | Python 3.7 (Optional) |
2735
+--------------+------------------------------+
2836

29-
.. [*] Even though this tutorial is mostly based (and properly tested) on Windows 10, information is also provided for Linux systems.
30-
3137
.. toctree::
3238
:maxdepth: 4
3339
:caption: Contents:

0 commit comments

Comments
 (0)