You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/10 15:10:00 UTC

[GitHub] [beam] yeandy commented on a diff in pull request #21758: Add README for image classification example

yeandy commented on code in PR #21758:
URL: https://github.com/apache/beam/pull/21758#discussion_r894633868


##########
sdks/python/apache_beam/examples/inference/README.md:
##########
@@ -0,0 +1,114 @@
+<!--
+    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.
+-->
+
+# Example RunInference API Pipelines
+
+This module contains example pipelines that use the Beam RunInference
+API. <!---TODO: Add link to full documentation on Beam website when it's published.-->
+
+## Pre-requisites
+
+You must have `apache-beam>=2.40.0` installed in order to run these pipelines,
+because the `apache_beam.examples.inference` module was added in that release.
+Using the RunInference API also `torch` to be installed. 
+
+To install for a local pipeline, run:
+```
+pip install apache-beam torch==1.11.0
+```
+
+To install for a Dataflow pipeline, refer to these
+[instructions](https://beam.apache.org/documentation/sdks/python-pipeline-dependencies/#pypi-dependencies).
+You'll need to add `torch` to a `requirements.txt` file, and then run your
+pipeline with the following command-line option:
+```
+--requirements_file requirements.txt
+```
+
+<!---
+TODO: Add link to full documentation on Beam website when it's published.
+
+i.e. "See the
+[documentation](https://beam.apache.org/documentation/dsls/dataframes/overview/#pre-requisites)
+for details."
+-->
+
+## Image Classification with ImageNet dataset
+
+[`pytorch_image_classification.py`](./pytorch_image_classification.py) contains
+an implementation for a RunInference pipeline thatpeforms image classification
+on [ImageNet dataset](https://www.image-net.org/) using the MobileNetV2
+architecture.
+
+The pipeline reads the images, performs basic preprocessing, passes them to the
+PyTorch implementation of RunInference, and then writes the predictions
+to a text file in GCS.
+
+### Data
+Data related to RunInference has been staged in
+`gs://apache-beam-ml/` for use with these example pipelines:

Review Comment:
   It's not intended to be a link, but rather to show the location of datasets, models, etc. related to RunInference. The `apache-beam-ml` bucket is public; outside users should be able to view (with command `gsutil ls gs://apache-beam-ml`) and read these models / datasets with no issue?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org