-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
32
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
32 commits
Select commit
Hold shift + click to select a range
ebecdb9
ML pipelines: RunInference - OSS Image Object detection
Amar3tto c6fa34d
Refactoring
Amar3tto d583417
Add PyTorch Image Captioning BLIP + CLIP Batch
Amar3tto 5214df9
Refactoring
Amar3tto 1315e8f
Add PyTorch Image Classification EfficientNet-B0 Streaming (Right-fit…
Amar3tto 2e85e64
Fix lint
Amar3tto 30fa3f2
Rename files
Amar3tto 63f8e42
Add project argument
Amar3tto 2a00fc5
Fix inference_fn
Amar3tto 6e43258
Fix inference result
Amar3tto 470bee5
Update torch for image captioning
Amar3tto f07d2fc
Fix inference
Amar3tto 3c8a7f4
Add Looker ids
Amar3tto cdeec42
Fix float for imagenet rightfit
Amar3tto ff93f0d
Add all pipelines to separate workflow
Amar3tto bc770f7
Fix streaming mode
Amar3tto 564ecfb
Fix clip blip
Amar3tto 648aaeb
Fix quotes
Amar3tto a5ca2a0
Fix formatting
Amar3tto e2711b2
Fix lint
Amar3tto 33d596b
Add Looker IDs
Amar3tto 27428d2
Resolve comments [1]
Amar3tto 06384d5
Resolve comments [2]
Amar3tto 5379bff
Resolve comments [3]
Amar3tto d6def59
Resolve comments [4]
Amar3tto 7dfdc4a
Fix conflicts
Amar3tto 9ce6c8e
Fix formatting
Amar3tto 27424cb
Remove rate limit
Amar3tto a1b0104
Refactor model and process init
Amar3tto fb4243e
Add beam_Inference_Python_Benchmarks_Dataflow_2 to README.md
Amar3tto 5f31795
Refactoring
Amar3tto d3a8653
Move to one yml file
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
143 changes: 139 additions & 4 deletions
143
.github/workflows/beam_Inference_Python_Benchmarks_Dataflow.yml
Large diffs are not rendered by default.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
...s-pipeline-options/beam_Inference_Python_Benchmarks_Dataflow_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 |
41 changes: 41 additions & 0 deletions
41
...tions/beam_Inference_Python_Benchmarks_Dataflow_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,41 @@ | ||
| # 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 | ||
| --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
...line-options/beam_Inference_Python_Benchmarks_Dataflow_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.
Uh oh!
There was an error while loading. Please reload this page.