Skip to content

Commit 9cafa3d

Browse files
author
TF Object Detection Team
committed
Merge pull request #13619 from bhandarivijay-png:ai-gsutil-migration-47972d7364c841cf86d08cd7c9650e23
PiperOrigin-RevId: 884853726
2 parents 46d9a77 + 635a635 commit 9cafa3d

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

docs/vision/instance_segmentation.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@
511511
"if not os.path.exists(model_ckpt_path):\n",
512512
" os.mkdir(model_ckpt_path)\n",
513513
"\n",
514-
"!gsutil cp gs://tf_model_garden/vision/mobilenet/v2_1.0_float/ckpt-180648.data-00000-of-00001 './model_ckpt/'\n",
515-
"!gsutil cp gs://tf_model_garden/vision/mobilenet/v2_1.0_float/ckpt-180648.index './model_ckpt/'"
514+
"!gcloud storage cp gs://tf_model_garden/vision/mobilenet/v2_1.0_float/ckpt-180648.data-00000-of-00001 './model_ckpt/'\n",
515+
"!gcloud storage cp gs://tf_model_garden/vision/mobilenet/v2_1.0_float/ckpt-180648.index './model_ckpt/'"
516516
]
517517
},
518518
{

docs/vision/semantic_segmentation.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@
378378
"if not os.path.exists(model_ckpt_path):\n",
379379
" os.mkdir(model_ckpt_path)\n",
380380
"\n",
381-
"!gsutil cp gs://tf_model_garden/cloud/vision-2.0/deeplab/deeplabv3_mobilenetv2_coco/best_ckpt-63.data-00000-of-00001 './model_ckpt/'\n",
382-
"!gsutil cp gs://tf_model_garden/cloud/vision-2.0/deeplab/deeplabv3_mobilenetv2_coco/best_ckpt-63.index './model_ckpt/'"
381+
"!gcloud storage cp gs://tf_model_garden/cloud/vision-2.0/deeplab/deeplabv3_mobilenetv2_coco/best_ckpt-63.data-00000-of-00001 './model_ckpt/'\n",
382+
"!gcloud storage cp gs://tf_model_garden/cloud/vision-2.0/deeplab/deeplabv3_mobilenetv2_coco/best_ckpt-63.index './model_ckpt/'"
383383
]
384384
},
385385
{

official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def main(_) -> None:
126126

127127
# Copy the images folder from GCP to the present directory.
128128
input_directory = (INPUT_DIRECTORY.value).rstrip("/\\")
129-
command = f"gsutil -m cp -r {input_directory} ."
129+
command = f"gcloud storage cp --recursive {input_directory} ."
130130
subprocess.run(command, shell=True, check=True)
131131

132132
# Create a folder to store the predictions.
@@ -361,7 +361,7 @@ def main(_) -> None:
361361

362362
# Move the tracking visualization to the output directory.
363363
commands = [
364-
f"gsutil -m cp -r {output_folder} {OUTPUT_DIRECTORY.value}",
364+
f"gcloud storage cp --recursive {output_folder} {OUTPUT_DIRECTORY.value}",
365365
f"rm -r {output_folder}",
366366
]
367367
combined_command_1 = " && ".join(commands)
@@ -383,7 +383,7 @@ def main(_) -> None:
383383

384384
# Move the cropped objects to the output directory.
385385
commands = [
386-
f"gsutil -m cp -r {cropped_obj_folder} {OUTPUT_DIRECTORY.value}",
386+
f"gcloud storage cp --recursive {cropped_obj_folder} {OUTPUT_DIRECTORY.value}",
387387
f"rm -r {cropped_obj_folder}",
388388
]
389389

@@ -423,11 +423,11 @@ def main(_) -> None:
423423
# Move the folders to the destination bucket.
424424
commands = [
425425
(
426-
"gsutil -m cp -r"
426+
"gcloud storage cp --recursive"
427427
f" {os.path.basename(input_directory)} {OUTPUT_DIRECTORY.value}"
428428
),
429429
f"rm -r {os.path.basename(input_directory)}",
430-
f"gsutil -m cp -r {prediction_folder} {OUTPUT_DIRECTORY.value}",
430+
f"gcloud storage cp --recursive {prediction_folder} {OUTPUT_DIRECTORY.value}",
431431
f"rm -r {prediction_folder}",
432432
]
433433

official/projects/waste_identification_ml/llm_applications/milk_pouch_detection/deploy.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ echo ""
183183
# ---
184184

185185
echo "✅ Step 4: Create GCS Buckets..."
186-
gsutil mb \
187-
-p "${PROJECT_ID}" \
188-
-l "${REGION}" \
189-
-c standard \
190-
-b on "gs://${SOURCE_BUCKET_NAME}" \
186+
gcloud storage buckets create "gs://${SOURCE_BUCKET_NAME}" \
187+
--project="${PROJECT_ID}" \
188+
--location="${REGION}" \
189+
--default-storage-class=standard \
190+
--uniform-bucket-level-access \
191191
|| echo "Source Bucket 'gs://${SOURCE_BUCKET_NAME}' already exists."
192192
echo "GCS Buckets are ready."
193193
echo ""
@@ -324,5 +324,5 @@ echo ""
324324

325325
echo "🚀🚀🚀 Deployment complete! 🚀🚀🚀"
326326
echo "You can upload files to the source bucket to be processed in the next run:"
327-
echo "gsutil cp your-local-image.jpg gs://${SOURCE_BUCKET_NAME}/"
327+
echo "gcloud storage cp your-local-image.jpg gs://${SOURCE_BUCKET_NAME}/"
328328
echo "Check the results in the bucket's subfolders."

official/projects/waste_identification_ml/model_inference_with_tracking/Inference_Detectron2_Pipeline_with_Tracking_experimental.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"source": [
166166
"# # Connect to GCP bucket if your data is store there and copy them locally.\n",
167167
"# !gcloud init\n",
168-
"# gsutil -m cp -r gs://input ."
168+
"# gcloud storage cp --recursive gs://input ."
169169
]
170170
},
171171
{

research/object_detection/g3doc/running_pets.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ copy the files into your GCS bucket (substituting `${YOUR_GCS_BUCKET}`):
105105

106106
```bash
107107
# From tensorflow/models/research/
108-
gsutil cp pet_faces_train.record-* gs://${YOUR_GCS_BUCKET}/data/
109-
gsutil cp pet_faces_val.record-* gs://${YOUR_GCS_BUCKET}/data/
110-
gsutil cp object_detection/data/pet_label_map.pbtxt gs://${YOUR_GCS_BUCKET}/data/pet_label_map.pbtxt
108+
gcloud storage cp pet_faces_train.record-* gs://${YOUR_GCS_BUCKET}/data/
109+
gcloud storage cp pet_faces_val.record-* gs://${YOUR_GCS_BUCKET}/data/
110+
gcloud storage cp object_detection/data/pet_label_map.pbtxt gs://${YOUR_GCS_BUCKET}/data/pet_label_map.pbtxt
111111
```
112112

113113
Please remember the path where you upload the data to, as we will need this
@@ -128,7 +128,7 @@ Bucket.
128128
``` bash
129129
wget http://storage.googleapis.com/download.tensorflow.org/models/object_detection/faster_rcnn_resnet101_coco_11_06_2017.tar.gz
130130
tar -xvf faster_rcnn_resnet101_coco_11_06_2017.tar.gz
131-
gsutil cp faster_rcnn_resnet101_coco_11_06_2017/model.ckpt.* gs://${YOUR_GCS_BUCKET}/data/
131+
gcloud storage cp faster_rcnn_resnet101_coco_11_06_2017/model.ckpt.* gs://${YOUR_GCS_BUCKET}/data/
132132
```
133133

134134
Remember the path where you uploaded the model checkpoint to, as we will need it
@@ -160,7 +160,7 @@ sed -i "s|PATH_TO_BE_CONFIGURED|"gs://${YOUR_GCS_BUCKET}"/data|g" \
160160
object_detection/samples/configs/faster_rcnn_resnet101_pets.config
161161

162162
# Copy edited template to cloud.
163-
gsutil cp object_detection/samples/configs/faster_rcnn_resnet101_pets.config \
163+
gcloud storage cp object_detection/samples/configs/faster_rcnn_resnet101_pets.config \
164164
gs://${YOUR_GCS_BUCKET}/data/faster_rcnn_resnet101_pets.config
165165
```
166166

@@ -285,7 +285,7 @@ command from `tensorflow/models/research/`:
285285

286286
```bash
287287
# From tensorflow/models/research/
288-
gsutil cp gs://${YOUR_GCS_BUCKET}/model_dir/model.ckpt-${CHECKPOINT_NUMBER}.* .
288+
gcloud storage cp gs://${YOUR_GCS_BUCKET}/model_dir/model.ckpt-${CHECKPOINT_NUMBER}.* .
289289
python object_detection/export_inference_graph.py \
290290
--input_type image_tensor \
291291
--pipeline_config_path object_detection/samples/configs/faster_rcnn_resnet101_pets.config \

0 commit comments

Comments
 (0)