Skip to content

Commit

Permalink
document ARM (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdwyer2 authored and xuhdev committed Nov 15, 2019
1 parent 67c86cb commit 5d25fa5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
10 changes: 0 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,3 @@ matrix:
- os: linux
arch: arm64
env: DOCKERFILE=Dockerfile.arm32v7 IMAGE=arm ARCH=arm32v7
- if: type = push AND (branch = master OR tag IS present)
stage: "Docker Manifest"
addons:
apt:
packages:
- docker-ce
install:
before_script:
script:
after_success:
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ Y. Song, S. Guadarrama, K. Murphy_, ["Speed/accuracy trade-offs for modern convo

To run the docker image, which automatically starts the model serving API, run:

```
Intel CPUs:
```bash
$ docker run -it -p 5000:5000 codait/max-object-detector
```

ARM CPUs (eg Raspberry Pi):
```bash
$ docker run -it -p 5000:5000 codait/max-object-detector:arm-arm32v7-latest
```

This will pull a pre-built image from Docker Hub (or use an existing image if already cached locally) and run it.
If you'd rather checkout and build the model locally you can follow the [run locally](#run-locally) steps below.

Expand All @@ -65,7 +71,7 @@ You can also deploy the model on Kubernetes using the latest docker image on Doc

On your Kubernetes cluster, run the following commands:

```
```bash
$ kubectl apply -f https://raw.githubusercontent.com/IBM/MAX-Object-Detector/master/max-object-detector.yaml
```

Expand All @@ -87,30 +93,36 @@ A more elaborate tutorial on how to deploy this MAX model to production on [IBM

Clone this repository locally. In a terminal, run the following command:

```
```bash
$ git clone https://github.com/IBM/MAX-Object-Detector.git
```

Change directory into the repository base folder:

```
```bash
$ cd MAX-Object-Detector
```

To build the docker image locally, run:
To build the docker image locally for Intel CPUs, run:

```
```bash
$ docker build -t max-object-detector .
```

For ARM CPUs (eg Raspberry Pi), run:

```bash
$ docker build -f Dockerfile.arm32v7 -t max-object-detector .
```

All required model assets will be downloaded during the build process. _Note_ that currently this docker image is CPU only (we will add support for GPU images later).


### 2. Deploy the Model

To run the docker image, which automatically starts the model serving API, run:

```
```bash
$ docker run -it -p 5000:5000 max-object-detector
```

Expand All @@ -124,7 +136,7 @@ Use the `model/predict` endpoint to load a test image (you can use one of the te

You can also test it on the command line, for example:

```
```bash
$ curl -F "image=@samples/dog-human.jpg" -XPOST http://127.0.0.1:5000/model/predict
```

Expand Down Expand Up @@ -162,7 +174,7 @@ You should see a JSON response like that below:

You can also control the probability threshold for what objects are returned using the `threshold` argument like below:

```
```bash
$ curl -F "image=@samples/dog-human.jpg" -XPOST http://127.0.0.1:5000/model/predict?threshold=0.5
```

Expand All @@ -175,7 +187,7 @@ The default value for `threshold` is `0.7`.

Run the following command from the model repo base folder, in a new terminal window:

```
```bash
$ jupyter notebook
```

Expand Down Expand Up @@ -205,7 +217,7 @@ and provides interactive visualization of the bounding boxes and their related l

If you wish to disable the web app, start the model serving API by running:

```
```bash
$ docker run -it -p 5000:5000 -e DISABLE_WEB_APP=true codait/max-object-detector
```

Expand Down

0 comments on commit 5d25fa5

Please sign in to comment.