-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ML pipelines: RunInference - OSS Image Object detection, OSS Image Captioning, OSS Image Classification #37186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Amar3tto
wants to merge
21
commits into
master
Choose a base branch
from
oss-image-detection
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6a09efb
ML pipelines: RunInference - OSS Image Object detection
Amar3tto 281509a
Refactoring
Amar3tto a22d694
Add PyTorch Image Captioning BLIP + CLIP Batch
Amar3tto 64187d9
Refactoring
Amar3tto b7edf62
Add PyTorch Image Classification EfficientNet-B0 Streaming (Right-fit…
Amar3tto 006f650
Fix lint
Amar3tto a3dafe4
Rename files
Amar3tto 0a80470
Add project argument
Amar3tto e398220
Fix inference_fn
Amar3tto 169b022
Fix inference result
Amar3tto 7dd82b3
Update torch for image captioning
Amar3tto 1d654cd
Fix inference
Amar3tto 9dca475
Add Looker ids
Amar3tto 126d30b
Fix float for imagenet rightfit
Amar3tto 8126ddb
Add all pipelines to separate workflow
Amar3tto 6c01f24
Fix streaming mode
Amar3tto 1bb5c36
Fix clip blip
Amar3tto c76849d
Fix quotes
Amar3tto c5b356d
Fix formatting
Amar3tto aa8ac62
Fix lint
Amar3tto d86d3df
Add Looker IDs
Amar3tto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
224 changes: 224 additions & 0 deletions
224
.github/workflows/beam_Inference_Python_Benchmarks_Dataflow_2.yml
Large diffs are not rendered by default.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
...pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_2_Pytorch_Image_Captioning.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # 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. | ||
|
|
||
| --region=us-central1 | ||
| --worker_machine_type=n1-standard-4 | ||
| --num_workers=50 | ||
| --disk_size_gb=50 | ||
| --autoscaling_algorithm=NONE | ||
| --staging_location=gs://temp-storage-for-perf-tests/loadtests | ||
| --temp_location=gs://temp-storage-for-perf-tests/loadtests | ||
| --requirements_file=apache_beam/ml/inference/pytorch_image_captioning_requirements.txt | ||
| --publish_to_big_query=true | ||
| --metrics_dataset=beam_run_inference | ||
| --input_options={} | ||
| --influx_measurement=result_torch_inference_image_captioning | ||
| --input=gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt | ||
| --blip_model_name=Salesforce/blip-image-captioning-base | ||
| --blip_batch_size=4 | ||
| --num_captions=5 | ||
| --max_new_tokens=30 | ||
| --num_beams=5 | ||
| --clip_model_name=openai/clip-vit-base-patch32 | ||
| --clip_batch_size=8 | ||
| --clip_score_normalize=false | ||
| --runner=DataflowRunner | ||
| --experiments=use_runner_v2 |
42 changes: 42 additions & 0 deletions
42
...ons/beam_Inference_Python_Benchmarks_Dataflow_2_Pytorch_Image_Classification_Rightfit.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # 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. | ||
|
|
||
| --region=us-central1 | ||
| --machine_type=n1-standard-4 | ||
| --num_workers=50 | ||
| --disk_size_gb=50 | ||
| --autoscaling_algorithm=NONE | ||
| --staging_location=gs://temp-storage-for-perf-tests/loadtests | ||
| --temp_location=gs://temp-storage-for-perf-tests/loadtests | ||
| --requirements_file=apache_beam/ml/inference/pytorch_rightfit_requirements.txt | ||
| --publish_to_big_query=true | ||
| --metrics_dataset=beam_run_inference | ||
| --influx_measurement=torch_inference_imagenet_stream_rightfit | ||
| --pretrained_model_name=efficientnet_b0 | ||
| --input_file=gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt | ||
| --runner=DataflowRunner | ||
| --mode=streaming | ||
| --input_mode=gcs_uris | ||
| --input_options={} | ||
| --pubsub_topic=projects/apache-beam-testing/topics/images_topic | ||
| --pubsub_subscription=projects/apache-beam-testing/subscriptions/images_subscription | ||
| --model_state_dict_path=gs://apache-beam-ml/models/efficientnet_b0_state_dict.pth | ||
| --rate_limit=250 | ||
| --image_size=224 | ||
| --top_k=5 | ||
| --inference_batch_size=auto | ||
| --window_sec=60 | ||
| --trigger_proc_time_sec=30 |
37 changes: 37 additions & 0 deletions
37
...ne-options/beam_Inference_Python_Benchmarks_Dataflow_2_Pytorch_Image_Object_Detection.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # 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. | ||
|
|
||
| --region=us-central1 | ||
| --worker_machine_type=n1-standard-4 | ||
| --num_workers=50 | ||
| --disk_size_gb=50 | ||
| --autoscaling_algorithm=NONE | ||
| --staging_location=gs://temp-storage-for-perf-tests/loadtests | ||
| --temp_location=gs://temp-storage-for-perf-tests/loadtests | ||
| --requirements_file=apache_beam/ml/inference/pytorch_image_object_detection_requirements.txt | ||
| --publish_to_big_query=true | ||
| --metrics_dataset=beam_run_inference | ||
| --input_options={} | ||
| --influx_measurement=result_torch_inference_image_object_detection_batch | ||
| --pretrained_model_name=fasterrcnn_resnet50_fpn | ||
| --inference_batch_size=8 | ||
| --resize_shorter_side=800 | ||
| --score_threshold=0.5 | ||
| --max_detections=50 | ||
| --input=gs://apache-beam-ml/testing/inputs/openimage_50k_benchmark.txt | ||
| --model_state_dict_path=gs://apache-beam-ml/models/torchvision.detection.fasterrcnn_resnet50_fpn.pth | ||
| --runner=DataflowRunner | ||
| --experiments=use_runner_v2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to split these into different workflows? If it is just about minimizing the time it takes to run, could we do one workflow with 2 jobs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or if there is a reason, could you add a comment explaining it? (maybe what I'm suggesting would exhaust resources and we need different cron schedules?)