You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/html/_sources/index.rst.txt
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ The software tools which we shall use throughout this tutorial are listed in the
29
29
.. [*] Even though this tutorial is based on Windows 10, most steps (excluding the setting of environmental variables) should apply for Ubuntu 16.04, too.
2018-03-2121:46:18.962971: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1212] Found device 0 with properties:
2018-03-2121:46:18.978254: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1312] Adding visible gpu devices: 0
229
-
2018-03-2121:46:19.295152: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1414 MB memory) -> physical GPU (device: 0, name: GeForce GTX 770, pci bus id: 0000:02:00.0, compute capability: 3.0)
224
+
2019-02-2806:56:43.617192: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
225
+
2019-02-2806:56:43.792865: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1356] Found device 0 with properties:
2019-02-2806:56:43.799610: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1435] Adding visible gpu devices: 0
230
+
2019-02-2806:56:44.338771: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
231
+
2019-02-2806:56:44.348418: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:929] 0
232
+
2019-02-2806:56:44.351039: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:942] 0: N
233
+
2019-02-2806:56:44.352873: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6387 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
230
234
231
235
- Finally, for the sake of completing the test as described by TensorFlow themselves (see `here <https://www.tensorflow.org/install/install_windows#validate_your_installation>`_), let's run the following:
232
236
@@ -263,19 +267,23 @@ Building on the assumption that you have just created your new virtual environme
263
267
| opencv | 3.3.1-py36h20b85fd_1 |
264
268
+--------------+------------------------------+
265
269
266
-
The packages can be install by running:
270
+
The packages can be installed using ``conda`` by running:
where ``<package_name>`` can be replaced with the name of the package, and optionally the package version can be specified by adding the optional specifier ``=<version>`` after ``<package_name>``.
276
+
where ``<package_name>`` can be replaced with the name of the package, and optionally the package version can be specified by adding the optional specifier ``=<version>`` after ``<package_name>``. For example, to simply install all packages at their latest versions you can run:
but you will need to install ``opencv-python`` instead of ``opencv``.
281
289
@@ -298,70 +306,121 @@ Downloading the TensorFlow Models
298
306
299
307
.. [#] The latest repo commit when writing this tutorial is `da903e0 <https://github.com/tensorflow/models/commit/da903e07aea0887d59ebf612557243351ddfb4e6>`_.
300
308
309
+
Protobuf Installation/Compilation
310
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
311
+
312
+
The Tensorflow Object Detection API uses Protobufs to configure model and
313
+
training parameters. Before the framework can be used, the Protobuf libraries
314
+
must be downloaded and compiled.
315
+
316
+
This should be done as follows:
317
+
318
+
- Head to the `protoc releases page <https://github.com/google/protobuf/releases>`_
319
+
- Download the latest ``*-win32.zip`` release (e.g. ``protoc-3.5.1-win32.zip``)
320
+
- Create a folder in ``C:\Program Files`` and name it ``Google Protobuf``.
321
+
- Extract the contents of the downloaded ``*-win32.zip``, inside ``C:\Program Files\Google Protobuf``
322
+
- Add ``C:\Program Files\Google Protobuf\bin`` to your ``Path`` environment variable (see :ref:`set_env`)
323
+
- In a new `Anaconda/Command Prompt` [#]_, ``cd`` into ``TensorFlow/models/research/`` directory and run the following command:
If you are on Windows and using Protobuf 3.5 or later, the multi-file selection wildcard (i.e ``*.proto``) will not work but you can do one of the following:
2. Alternatively, if you are using `Command Prompt`
341
+
342
+
.. code-block:: python
343
+
344
+
# From within TensorFlow/models/research/
345
+
for/f %i in ('dir /b object_detection\protos\*.proto') do protoc object_detection\protos\%i --python_out=.
346
+
347
+
348
+
.. [#] NOTE: You MUST open a new `Anaconda/Command Prompt` for the changes in the environment variables to take effect.
349
+
350
+
301
351
Adding necessary Environment Variables
302
352
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
303
353
304
-
Since a lot of the scripts we will use require packages from ``Tensorflow\models\research\object_detection`` to be run, I have found that it's convenient to add the specific folder to our environmental variables.
354
+
1. As ``Tensorflow\models\research\object_detection`` is the core package for object detection, it's convenient to add the specific folder to our environmental variables.
305
355
306
-
For Linux users, this can be done by either adding to ``~/.bashrc`` or running the following code:
356
+
- Linux: This can be done by either adding to ``~/.bashrc`` or running the following:
For whatever reason, some of the TensorFlow packages that we will need to use to do object detection, do not come pre-installed with our tensorflow installation.
366
+
.. note:: The above can also be achieved, in both Linux and Windows environments, by running the following from ``Tensorflow\models\research``:
317
367
318
-
For Linux users ONLY, the `Installation docs <https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md>`_ suggest that you either run, or add to ``~/.bashrc`` file, the following command, which adds these packages to your PYTHONPATH:
368
+
.. code-block:: python
319
369
320
-
.. code-block:: bash
370
+
# From within TensorFlow/models/research/
371
+
python setup.py build
372
+
python setup.py install
321
373
322
-
# From tensorflow/models/research/
323
-
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
374
+
The above commands essentially build and install the ``object_detection`` Python package.
375
+
376
+
**DRAWBACK**: The above commands need to be run everytime there is a change/update of the ``object_detection`` package.
324
377
325
-
For Windows, the only way that I found works best, is to simply add the following folders to your ``Path`` environment variable (See also :ref:`set_env`):
378
+
2. For whatever reason, some of the TensorFlow packages that are required to perform object detection, do not come pre-installed with our tensorflow installation.
- Linux: The `Installation docs <https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md>`_ suggest that you either run, or add to ``~/.bashrc`` file, the following command, which adds these packages to your PYTHONPATH:
333
381
334
-
where ``<PATH_TO_TF>`` replaces the absolute path to your ``TesnorFlow`` folder. (e.g. ``<PATH_TO_TF>`` = ``C:\Users\sglvladi\Documents`` if ``TensorFlow`` resides within your ``Documents`` folder)
The Tensorflow Object Detection API uses Protobufs to configure model and
340
-
training parameters. Before the framework can be used, the Protobuf libraries
341
-
must be downloaded and compiled.
387
+
- Windows: The only way that I found works best, is to simply add the following folders to your ``PYTHONPATH`` environment variable (See also :ref:`set_env`):
- Head to the `protoc releases page <https://github.com/google/protobuf/releases>`_
346
-
- Download the latest ``*-win32.zip`` release (e.g. ``protoc-3.5.1-win32.zip``)
347
-
- Create a folder in ``C:\Program Files`` and name it ``Google Protobuf``.
348
-
- Extract the contents of the downloaded ``*-win32.zip``, inside ``C:\Program Files\Google Protobuf``
349
-
- Add ``C:\Program Files\Google Protobuf\bin`` to your ``Path`` environment variable (see :ref:`set_env`)
350
-
- In a new `Anaconda/Command Prompt` [#]_, ``cd`` into ``TensorFlow/models/research/`` directory and run the following command:
392
+
where, in both cases, ``<PATH_TO_TF>`` replaces the absolute path to your ``TesnorFlow`` folder. (e.g. ``<PATH_TO_TF>`` = ``C:\Users\sglvladi\Documents`` if ``TensorFlow`` resides within your ``Documents`` folder)
Note that, according to the `package's instructions <https://github.com/philferriere/cocoapi#this-clones-readme>`_, Visual C++ 2015 build tools must be installed and on your path. If they are not, make sure to install them from `here <https://go.microsoft.com/fwlink/?LinkId=691126>`_.
409
+
410
+
2. Linux:
411
+
412
+
Download `cocoapi <https://github.com/cocodataset/cocoapi>`_ to a directory of your choice, then ``make`` and copy the pycocotools subfolder to the ``Tensorflow/models/research`` directory, as such:
The default metrics are based on those used in Pascal VOC evaluation. To use the COCO object detection metrics add `metrics_set: "coco_detection_metrics"` to the `eval_config` message in the config file. To use the COCO instance segmentation metrics add `metrics_set: "coco_mask_metrics"` to the `eval_config` message in the config file.
363
423
364
-
.. [#] NOTE: You MUST open a new `Anaconda/Command Prompt` for the changes in the environment variables to take effect.
365
424
366
425
.. _test_tf_models:
367
426
@@ -373,7 +432,7 @@ Test your Installation
373
432
374
433
.. code-block:: posh
375
434
376
-
# From TensorFlow/models/research/object_detection
435
+
# From within TensorFlow/models/research/object_detection
377
436
jupyter notebook
378
437
379
438
- This should start a new ``jupyter notebook`` server on your machine and you should be redirected to a new tab of your default browser.
@@ -435,7 +494,6 @@ Downloading labelImg
435
494
|├── samples
436
495
|└── tutorials
437
496
|
438
-
|
439
497
440
498
.. [#] The latest repo commit when writing this tutorial is `8d1bd68 <https://github.com/tzutalin/labelImg/commit/8d1bd68ab66e8c311f2f45154729bba301a81f0b>`_.
0 commit comments