diff --git a/docs/vision/instance_segmentation.ipynb b/docs/vision/instance_segmentation.ipynb index 1f8f21eddab..d3f8cc13d5e 100644 --- a/docs/vision/instance_segmentation.ipynb +++ b/docs/vision/instance_segmentation.ipynb @@ -511,8 +511,8 @@ "if not os.path.exists(model_ckpt_path):\n", " os.mkdir(model_ckpt_path)\n", "\n", - "!gsutil cp gs://tf_model_garden/vision/mobilenet/v2_1.0_float/ckpt-180648.data-00000-of-00001 './model_ckpt/'\n", - "!gsutil cp gs://tf_model_garden/vision/mobilenet/v2_1.0_float/ckpt-180648.index './model_ckpt/'" + "!gcloud storage cp gs://tf_model_garden/vision/mobilenet/v2_1.0_float/ckpt-180648.data-00000-of-00001 './model_ckpt/'\n", + "!gcloud storage cp gs://tf_model_garden/vision/mobilenet/v2_1.0_float/ckpt-180648.index './model_ckpt/'" ] }, { diff --git a/docs/vision/semantic_segmentation.ipynb b/docs/vision/semantic_segmentation.ipynb index ca4ae43dbfe..e5db8cb4ce0 100644 --- a/docs/vision/semantic_segmentation.ipynb +++ b/docs/vision/semantic_segmentation.ipynb @@ -378,8 +378,8 @@ "if not os.path.exists(model_ckpt_path):\n", " os.mkdir(model_ckpt_path)\n", "\n", - "!gsutil cp gs://tf_model_garden/cloud/vision-2.0/deeplab/deeplabv3_mobilenetv2_coco/best_ckpt-63.data-00000-of-00001 './model_ckpt/'\n", - "!gsutil cp gs://tf_model_garden/cloud/vision-2.0/deeplab/deeplabv3_mobilenetv2_coco/best_ckpt-63.index './model_ckpt/'" + "!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", + "!gcloud storage cp gs://tf_model_garden/cloud/vision-2.0/deeplab/deeplabv3_mobilenetv2_coco/best_ckpt-63.index './model_ckpt/'" ] }, { diff --git a/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py b/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py index cbff63902ec..adaac126e90 100644 --- a/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py +++ b/official/projects/waste_identification_ml/Triton_TF_Cloud_Deployment/client/inference_pipeline.py @@ -126,7 +126,7 @@ def main(_) -> None: # Copy the images folder from GCP to the present directory. input_directory = (INPUT_DIRECTORY.value).rstrip("/\\") - command = f"gsutil -m cp -r {input_directory} ." + command = f"gcloud storage cp --recursive {input_directory} ." subprocess.run(command, shell=True, check=True) # Create a folder to store the predictions. @@ -361,7 +361,7 @@ def main(_) -> None: # Move the tracking visualization to the output directory. commands = [ - f"gsutil -m cp -r {output_folder} {OUTPUT_DIRECTORY.value}", + f"gcloud storage cp --recursive {output_folder} {OUTPUT_DIRECTORY.value}", f"rm -r {output_folder}", ] combined_command_1 = " && ".join(commands) @@ -383,7 +383,7 @@ def main(_) -> None: # Move the cropped objects to the output directory. commands = [ - f"gsutil -m cp -r {cropped_obj_folder} {OUTPUT_DIRECTORY.value}", + f"gcloud storage cp --recursive {cropped_obj_folder} {OUTPUT_DIRECTORY.value}", f"rm -r {cropped_obj_folder}", ] @@ -423,11 +423,11 @@ def main(_) -> None: # Move the folders to the destination bucket. commands = [ ( - "gsutil -m cp -r" + "gcloud storage cp --recursive" f" {os.path.basename(input_directory)} {OUTPUT_DIRECTORY.value}" ), f"rm -r {os.path.basename(input_directory)}", - f"gsutil -m cp -r {prediction_folder} {OUTPUT_DIRECTORY.value}", + f"gcloud storage cp --recursive {prediction_folder} {OUTPUT_DIRECTORY.value}", f"rm -r {prediction_folder}", ] diff --git a/official/projects/waste_identification_ml/llm_applications/milk_pouch_detection/deploy.sh b/official/projects/waste_identification_ml/llm_applications/milk_pouch_detection/deploy.sh index 096c0c0983a..a50ec73c2f7 100755 --- a/official/projects/waste_identification_ml/llm_applications/milk_pouch_detection/deploy.sh +++ b/official/projects/waste_identification_ml/llm_applications/milk_pouch_detection/deploy.sh @@ -183,11 +183,11 @@ echo "" # --- echo "✅ Step 4: Create GCS Buckets..." -gsutil mb \ - -p "${PROJECT_ID}" \ - -l "${REGION}" \ - -c standard \ - -b on "gs://${SOURCE_BUCKET_NAME}" \ +gcloud storage buckets create "gs://${SOURCE_BUCKET_NAME}" \ + --project="${PROJECT_ID}" \ + --location="${REGION}" \ + --default-storage-class=standard \ + --uniform-bucket-level-access \ || echo "Source Bucket 'gs://${SOURCE_BUCKET_NAME}' already exists." echo "GCS Buckets are ready." echo "" @@ -324,5 +324,5 @@ echo "" echo "🚀🚀🚀 Deployment complete! 🚀🚀🚀" echo "You can upload files to the source bucket to be processed in the next run:" -echo "gsutil cp your-local-image.jpg gs://${SOURCE_BUCKET_NAME}/" +echo "gcloud storage cp your-local-image.jpg gs://${SOURCE_BUCKET_NAME}/" echo "Check the results in the bucket's subfolders." diff --git a/official/projects/waste_identification_ml/model_inference_with_tracking/Inference_Detectron2_Pipeline_with_Tracking_experimental.ipynb b/official/projects/waste_identification_ml/model_inference_with_tracking/Inference_Detectron2_Pipeline_with_Tracking_experimental.ipynb index 554cbb75cc4..e94a9a34607 100644 --- a/official/projects/waste_identification_ml/model_inference_with_tracking/Inference_Detectron2_Pipeline_with_Tracking_experimental.ipynb +++ b/official/projects/waste_identification_ml/model_inference_with_tracking/Inference_Detectron2_Pipeline_with_Tracking_experimental.ipynb @@ -165,7 +165,7 @@ "source": [ "# # Connect to GCP bucket if your data is store there and copy them locally.\n", "# !gcloud init\n", - "# gsutil -m cp -r gs://input ." + "# gcloud storage cp --recursive gs://input ." ] }, { diff --git a/research/object_detection/g3doc/running_pets.md b/research/object_detection/g3doc/running_pets.md index 7d6b7bfa7c0..2eaa487febf 100644 --- a/research/object_detection/g3doc/running_pets.md +++ b/research/object_detection/g3doc/running_pets.md @@ -105,9 +105,9 @@ copy the files into your GCS bucket (substituting `${YOUR_GCS_BUCKET}`): ```bash # From tensorflow/models/research/ -gsutil cp pet_faces_train.record-* gs://${YOUR_GCS_BUCKET}/data/ -gsutil cp pet_faces_val.record-* gs://${YOUR_GCS_BUCKET}/data/ -gsutil cp object_detection/data/pet_label_map.pbtxt gs://${YOUR_GCS_BUCKET}/data/pet_label_map.pbtxt +gcloud storage cp pet_faces_train.record-* gs://${YOUR_GCS_BUCKET}/data/ +gcloud storage cp pet_faces_val.record-* gs://${YOUR_GCS_BUCKET}/data/ +gcloud storage cp object_detection/data/pet_label_map.pbtxt gs://${YOUR_GCS_BUCKET}/data/pet_label_map.pbtxt ``` Please remember the path where you upload the data to, as we will need this @@ -128,7 +128,7 @@ Bucket. ``` bash wget http://storage.googleapis.com/download.tensorflow.org/models/object_detection/faster_rcnn_resnet101_coco_11_06_2017.tar.gz tar -xvf faster_rcnn_resnet101_coco_11_06_2017.tar.gz -gsutil cp faster_rcnn_resnet101_coco_11_06_2017/model.ckpt.* gs://${YOUR_GCS_BUCKET}/data/ +gcloud storage cp faster_rcnn_resnet101_coco_11_06_2017/model.ckpt.* gs://${YOUR_GCS_BUCKET}/data/ ``` 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" \ object_detection/samples/configs/faster_rcnn_resnet101_pets.config # Copy edited template to cloud. -gsutil cp object_detection/samples/configs/faster_rcnn_resnet101_pets.config \ +gcloud storage cp object_detection/samples/configs/faster_rcnn_resnet101_pets.config \ gs://${YOUR_GCS_BUCKET}/data/faster_rcnn_resnet101_pets.config ``` @@ -285,7 +285,7 @@ command from `tensorflow/models/research/`: ```bash # From tensorflow/models/research/ -gsutil cp gs://${YOUR_GCS_BUCKET}/model_dir/model.ckpt-${CHECKPOINT_NUMBER}.* . +gcloud storage cp gs://${YOUR_GCS_BUCKET}/model_dir/model.ckpt-${CHECKPOINT_NUMBER}.* . python object_detection/export_inference_graph.py \ --input_type image_tensor \ --pipeline_config_path object_detection/samples/configs/faster_rcnn_resnet101_pets.config \