Addressed comments

This commit is contained in:
ivanmkc@google.com
2023-03-20 18:01:44 -04:00
parent 9a61e3c722
commit e11598ca5a
@@ -154,7 +154,7 @@
"id": "97473593f37f"
},
"source": [
"Install the latest version of google-cloud-vision for filtering for safe images"
"Install the latest version of google-cloud-vision for filtering for safe images and pyrate_limiter for limiting Google Cloud Vision API calls"
]
},
{
@@ -166,29 +166,7 @@
"outputs": [],
"source": [
"# Install the packages\n",
"! pip install google-cloud-vision"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "63688938c0a4"
},
"source": [
"Install the latest version of pyrate_limiter for limiting Google Cloud Vision API calls"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "9838332960bd"
},
"outputs": [],
"source": [
"# Install the packages\n",
"! pip install pyrate_limiter"
"! pip install google-cloud-vision pyrate_limiter"
]
},
{
@@ -569,7 +547,7 @@
"source": [
"Define a function to query the Cloud Vision API to detect potential explicit images\n",
"\n",
"See details at [Detect explicit content](https://cloud.google.com/vision/docs/detecting-safe-search)"
"Learn more about explicit image detection at: [Detect explicit content](https://cloud.google.com/vision/docs/detecting-safe-search)"
]
},
{
@@ -587,10 +565,10 @@
"\n",
"client = vision.ImageAnnotatorClient()\n",
"\n",
"\"\"\"Detects unsafe features in the file.\"\"\"\n",
"\n",
"\n",
"def detect_safe_search(path: str) -> Optional[bool]:\n",
" \"\"\"Detects unsafe features in the file.\"\"\"\n",
"\n",
" with io.open(path, \"rb\") as image_file:\n",
" content = image_file.read()\n",
"\n",