diff --git a/official/projects/waste_identification_ml/model_inference/Inference.ipynb b/official/projects/waste_identification_ml/model_inference/Inference.ipynb index b5d584e96dd..d5673d130b8 100644 --- a/official/projects/waste_identification_ml/model_inference/Inference.ipynb +++ b/official/projects/waste_identification_ml/model_inference/Inference.ipynb @@ -101,7 +101,14 @@ "outputs": [], "source": [ "# Download the script to pull instance segmentation model weights from the TF Model Garden repo.\n", - "!wget -q https://raw.githubusercontent.com/tensorflow/models/master/official/projects/waste_identification_ml/model_inference/download_and_unzip_models.py" + "url = (\n", + " \"https://raw.githubusercontent.com/\"\n", + " \"tensorflow/models/master/\"\n", + " \"official/projects/waste_identification_ml/\"\n", + " \"model_inference/download_and_unzip_models.py\"\n", + ")\n", + "\n", + "!wget -q {url}" ] }, { @@ -219,8 +226,16 @@ "# 'material_model' output is both material and its sub type e.g. Plastics_PET.\n", "# 'material_form_model' outputs the form of an object e.g. can, bottle, etc.\n", "MODEL_WEIGHTS = {\n", - "'material_url' : 'https://storage.googleapis.com/tf_model_garden/vision/waste_identification_ml/two_model_strategy/material/material_version_2.zip',\n", - "'material_form_url' : 'https://storage.googleapis.com/tf_model_garden/vision/waste_identification_ml/two_model_strategy/material_form/material_form_version_2.zip',\n", + " 'material_url': (\n", + " 'https://storage.googleapis.com/tf_model_garden/vision/'\n", + " 'waste_identification_ml/two_model_strategy/material/'\n", + " 'material_version_2.zip'\n", + " ),\n", + " 'material_form_url': (\n", + " 'https://storage.googleapis.com/tf_model_garden/vision/'\n", + " 'waste_identification_ml/two_model_strategy/material_form/'\n", + " 'material_form_version_2.zip'\n", + " ),\n", "}\n", "\n", "ALL_MODELS = {\n", @@ -229,13 +244,22 @@ "}\n", "\n", "LABELS = {\n", - "'material_model' : 'models/official/projects/waste_identification_ml/pre_processing/config/data/two_model_strategy_material.csv',\n", - "'material_form_model' : 'models/official/projects/waste_identification_ml/pre_processing/config/data/two_model_strategy_material_form.csv',\n", + " 'material_model': (\n", + " 'models/official/projects/waste_identification_ml/pre_processing/'\n", + " 'config/data/two_model_strategy_material.csv'\n", + " ),\n", + " 'material_form_model': (\n", + " 'models/official/projects/waste_identification_ml/pre_processing/'\n", + " 'config/data/two_model_strategy_material_form.csv'\n", + " ),\n", "}\n", "\n", "# Path to a sample image stored in the repo.\n", "IMAGES_FOR_TEST = {\n", - " 'Image1' : 'models/official/projects/waste_identification_ml/pre_processing/config/sample_images/image_2.png'\n", + " 'Image1': (\n", + " 'models/official/projects/waste_identification_ml/pre_processing/'\n", + " 'config/sample_images/image_2.png'\n", + " )\n", "}" ] },