Skip to content

Commit

Permalink
update README.md with installation instructions for TensorFlow 2.2 (#27)
Browse files Browse the repository at this point in the history
* add a note to the README concerning /boot/config.txt (#22)

* Update README.md

* add a note about dtparam=i2c1=on in /boot/config.txt for Rasberry 4 Rasberian users

Co-authored-by: Leigh Johnson <[email protected]>
Co-authored-by: Matt Gantner <[email protected]>

* update README.md with installation instructions for TensorFlow 2.2

Co-authored-by: Matt <[email protected]>
Co-authored-by: Matt Gantner <[email protected]>
  • Loading branch information
3 people authored May 24, 2020
1 parent 78ec6ff commit 87b23cb
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 5 deletions.
73 changes: 69 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,68 @@ Before you get started, you should have an up-to-date installation of Raspbian 1
1. Install system dependencies

```bash
sudo apt-get update && sudo apt-get install -y \
$ sudo apt-get update && sudo apt-get install -y \
cmake python3-dev libjpeg-dev libatlas-base-dev raspi-gpio libhdf5-dev python3-smbus
```

2. Install TensorFlow 2.0 (community-built wheel)
1. Create new virtual environment

```bash
pip install https://github.com/leigh-johnson/Tensorflow-bin/blob/master/tensorflow-2.0.0-cp37-cp37m-linux_armv7l.whl?raw=true
$ python3 -m venv .venv
```

3. Activate virtual environment

```bash
$ source .venv/bin/activate
```

4. Upgrade setuptools

```bash
$ pip install --upgrade setuptools
```

5. Install TensorFlow 2.2 (community-built wheel)

```bash
$ pip install https://github.com/leigh-johnson/Tensorflow-bin/releases/download/v2.2.0/tensorflow-2.2.0-cp37-cp37m-linux_armv7l.whl

```

3. Install the `rpi-deep-pantilt` package.
6. Install the `rpi-deep-pantilt` package.

```bash
pip install rpi-deep-pantilt
```

=======
# Configuration

WARNING: Do not skip this section! You will not be able to use `rpi-deep-pantilt` without properly configuring your Pi.

### Enable Pi Camera

1. Run `sudo raspi-config` and select `Interfacing Options` from the Raspberry Pi Software Configuration Tool’s main menu. Press ENTER.

![raspi-config main menu](/images/camera1.png)

2. Select the Enable Camera menu option and press ENTER.

![raspi-config interfacing options menu](/images/camera2.png)

3. In the next menu, use the right arrow key to highlight ENABLE and press ENTER.

![raspi-config enable camera yes/no menu](/images/camera3.png)

### Enable i2c in Device Tree

1. Open `/boot/config.txt` and verify the following `dtparams` lines are uncommented:

```bash
dtparam=i2c1=on
dtparam=i2c_arm=on
```
# Example Usage

## Object Detection
Expand Down Expand Up @@ -173,6 +218,25 @@ I was able to use the same model architechture for FLOAT32 and UINT8 input, `fac

This model is derived from `facessd_mobilenet_v2_quantized_320x320_open_image_v4` in [tensorflow/models](https://github.com/tensorflow/models).

# Common Issues

### i2c is not enabled

If you run `$ rpi-deep-pantilt test pantilt` and see a similar error, check your Device Tree configuration.

```python
File "/home/pi/projects/rpi-deep-pantilt/.venv/lib/python3.7/site-packages/pantilthat/pantilt.py", line 72, in setup
self._i2c = SMBus(1)
FileNotFoundError: [Errno 2] No such file or directory
```

Open `/boot/config.txt` and ensure the following lines are uncommented:

```bash
dtparam=i2c1=on
dtparam=i2c_arm=on
```

# Credits

The MobileNetV3-SSD model in this package was derived from [TensorFlow's model zoo](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md), with [post-processing ops added](https://gist.github.com/leigh-johnson/155264e343402c761c03bc0640074d8c).
Expand All @@ -183,3 +247,4 @@ This package was created with
[Cookiecutter](https://github.com/audreyr/cookiecutter) and the
[audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage)
project template.

Binary file added images/camera1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/camera2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/camera3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
'Click>=7.0',
'pillow',
'h5py',
'tensorflow>=2.2.0'
]

trainer_requirements = [
'tensorflow==2.0.0',
'numpy'
]

Expand Down

0 comments on commit 87b23cb

Please sign in to comment.