Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom Lane committed Sep 11, 2018
2 parents 8dd5e29 + 597a637 commit a88ba51
Show file tree
Hide file tree
Showing 13 changed files with 465 additions and 224 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,4 @@ List of Contributors
* [Aaron Markham](https://github.com/aaronmarkham)
* [Sam Skalicky](https://github.com/samskalicky)
* [Per Goncalves da Silva](https://github.com/perdasilva)
* [Cheng-Che Lee](https://github.com/stu1130)
12 changes: 11 additions & 1 deletion docs/api/python/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,14 @@ Code examples are placed throughout the API documentation and these can be run a
:maxdepth: 1
symbol_in_pictures/symbol_in_pictures.md
```
```

## Tools

```eval_rst
.. toctree::
:maxdepth: 1
tools/test_utils.md
tools/visualization.md
```
27 changes: 27 additions & 0 deletions docs/api/python/tools/test_utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Test Utilities

This module has a variety of tools that help using and testing MXNet.

```eval_rst
.. currentmodule:: mxnet.test_utils
```

```eval_rst
.. autosummary::
:nosignatures:
mxnet.test_utils
```

## API Reference

<script type="text/javascript" src='../../../_static/js/auto_module_index.js'></script>

```eval_rst
.. automodule:: mxnet.test_utils
:members:
```

<script>auto_index("api-reference");</script>
27 changes: 27 additions & 0 deletions docs/api/python/tools/visualization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Visualization

This module contains visualization features.

```eval_rst
.. currentmodule:: mxnet.visualization
```

```eval_rst
.. autosummary::
:nosignatures:
mxnet.visualization
```

## API Reference

<script type="text/javascript" src='../../../_static/js/auto_module_index.js'></script>

```eval_rst
.. automodule:: mxnet.visualization
:members:
```

<script>auto_index("api-reference");</script>
8 changes: 4 additions & 4 deletions docs/community/mxnet_channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Converse with the MXNet community via the following channels:

- [Forum](https://discuss.mxnet.io/): [discuss.mxnet.io](https://discuss.mxnet.io/) <i class="fas fa-external-link-alt"></i>
- [MXNet Apache developer mailing list](https://lists.apache.org/[email protected]) ([email protected]): To subscribe, send an email to <a href="mailto:[email protected]">dev[email protected]</a> <i class="far fa-envelope"></i>
- [MXNet Apache user mailing list](https://lists.apache.org/[email protected]) ([email protected]): To subscribe, send an email to <a href="mailto:[email protected]">user[email protected]</a> <i class="far fa-envelope"></i>
- [MXNet Slack channel](https://apache-mxnet.slack.com): To request an invitation to the channel please subscribe to the mailing list above and then email: <a href="mailto:[email protected]">[email protected]</a> <i class="far fa-envelope"></i>
- [Forum](https://discuss.mxnet.io/): [discuss.mxnet.io](https://discuss.mxnet.io/)
- [MXNet Apache developer mailing list](https://lists.apache.org/[email protected]) ([email protected]): To subscribe, send an email to <a href="mailto:[email protected]">user[email protected]</a>
- [MXNet Apache user mailing list](https://lists.apache.org/[email protected]) ([email protected]): To subscribe, send an email to <a href="mailto:[email protected]">dev[email protected]</a>
- [MXNet Slack channel](https://the-asf.slack.com/) (Channel: #mxnet): To request an invitation to the channel please subscribe to the mailing list above and then email: <a href="mailto:[email protected]">[email protected]</a>

Note: if you have an email address with apache.org, you do not need an approval to join the MXNet Slack channel.
54 changes: 32 additions & 22 deletions example/image-classification/predict-cpp/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Image Classification Example of C++
This is a simple predictor which shows how to use c api for image classfication.
# Image Classification Example Using the C Predict API
This is a simple predictor which shows how to use the MXNet C Predict API for image classification with a pre-trained ImageNet model.

It uses opencv for image reading
## Prerequisites

# How to Use
* OpenCV for image processing: `USE_OPENCV` is set to true by default when [building from source](https://mxnet.incubator.apache.org/install/build_from_source.html)

## Build
1. Edit image-classification-predict.cc file, change the following lines to your model paths:
```bash
## How to Use this Example

### Download the Model Artifacts
1. You will need the model artifacts for the Inception ImageNet model. You can download these from http://data.mxnet.io/mxnet/models/imagenet/inception-bn/
2. Place them into a `model/Inception/` subfolder, or if not, you will need to edit the source file and update the paths in the Build step.

* [model/Inception/Inception-BN-symbol.json](http://data.mxnet.io/mxnet/models/imagenet/inception-bn/Inception-BN-symbol.json)
* [model/Inception/Inception-BN-0126.params](http://data.mxnet.io/mxnet/models/imagenet/inception-bn/Inception-BN-0126.params)
* [model/Inception/synset.txt](http://data.mxnet.io/mxnet/models/imagenet/synset.txt)

### Build
1. If using a different location for the model artifacts, edit `image-classification-predict.cc` file, and change the following lines to your artifacts' paths:
```c
// Models path for your model, you have to modify it
std::string json_file = "model/Inception/Inception-BN-symbol.json";
std::string param_file = "model/Inception/Inception-BN-0126.params";
Expand All @@ -16,47 +26,47 @@ It uses opencv for image reading
```

2. You may also want to change the image size and channels:
```bash
```c
// Image size and channels
int width = 224;
int height = 224;
int channels = 3;
```

3. Simply just use our Makefile to build:
```bash
make
```

## Usage
Run:
### Run
Run the example by passing it an image that you want to classify. If you don't have one handy, run the following to get one:
```bash
./image-classification-predict apple.jpg
wget https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Honeycrisp.jpg/1920px-Honeycrisp.jpg
```
Then run the `image-classification-predict` program, passing the image as the argument.
```bash
./image-classification-predict 1920px-Honeycrisp.jpg
```
The only parameter is the path of the test image.
## Tips
* The model used in the sample can be downloaded here:
http://pan.baidu.com/s/1sjXKrqX
or here:
http://data.mxnet.io/mxnet/models/imagenet/
* If you don't run it in the mxnet root path, maybe you will need to copy lib folder here.
* If you don't run it in the MXNet root path, you may need to copy the `lib` folder here.

# Author
## Author
* **Xiao Liu**

* E-mail: [email protected]

* Homepage: [www.liuxiao.org](http://www.liuxiao.org/)

# Thanks
## Thanks
* pertusa (for Makefile and image reading check)

* caprice-j (for reading function)

* sofiawu (for sample model)

* piiswrong and tqchen (for useful coding suggestions)
29 changes: 29 additions & 0 deletions python/mxnet/io/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# coding: utf-8
# pylint: disable=wildcard-import
""" Data iterators for common data formats and utility functions."""
from __future__ import absolute_import

from . import io
from .io import *

from . import utils
from .utils import *
Loading

0 comments on commit a88ba51

Please sign in to comment.