From f39d8f03a898d8c09163cc7c7482a8ff336ed5ca Mon Sep 17 00:00:00 2001 From: Alexander Suvorov Date: Fri, 1 Dec 2023 12:43:00 +0100 Subject: [PATCH] Add colab links check --- .ci/check_links.py | 19 ++++++++++++++++++- README_cn.md | 6 +++--- notebooks/102-pytorch-to-openvino/README.md | 2 +- notebooks/109-performance-tricks/README.md | 4 ++-- .../README.md | 2 +- notebooks/266-speculative-sampling/README.md | 2 +- 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.ci/check_links.py b/.ci/check_links.py index 9ff58a215b8..3c2cd591866 100644 --- a/.ci/check_links.py +++ b/.ci/check_links.py @@ -28,6 +28,18 @@ def get_all_references_from_md(md_path): yield node['link'] +def validate_colab_url(url: str) -> bool: + OPENVINO_COLAB_URL_PREFIX = 'https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/' + + if not url.startswith(OPENVINO_COLAB_URL_PREFIX): + return + + notebook_path = url.split(OPENVINO_COLAB_URL_PREFIX)[1] + absolute_notebook_path = NOTEBOOKS_ROOT / notebook_path + + if not absolute_notebook_path.exists(): + raise ValueError(f'notebook not found for colab url {url!r}') + def main(): all_passed = True @@ -56,7 +68,12 @@ def complain(message): continue try: - get = requests.get(url, timeout=5) + validate_colab_url(url) + except ValueError as err: + complain(f'{md_path}: {err}') + + try: + get = requests.get(url, timeout=10) if get.status_code != 200: if get.status_code in [500, 429, 443] and any([known_url in url for known_url in EXCEPTIONS_URLs]): print(f'SKIP - {md_path}: URL can not be reached {url!r}, status code {get.status_code}') diff --git a/README_cn.md b/README_cn.md index 4aca2bfa3b0..133bcb44558 100644 --- a/README_cn.md +++ b/README_cn.md @@ -140,7 +140,7 @@ Jupyter notebooks 分为四个大类,选择一个跟你需求相关的开始 | [202-vision-superresolution-image](notebooks/202-vision-superresolution/)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F202-vision-superresolution%2F202-vision-superresolution-image.ipynb)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/202-vision-superresolution/202-vision-superresolution-image.ipynb) | 使用超分辨率模型放大原始图像 | | | [202-vision-superresolution-video](notebooks/202-vision-superresolution/)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F202-vision-superresolution%2F202-vision-superresolution-video.ipynb)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/202-vision-superresolution/202-vision-superresolution-video.ipynb) | 使用超分辨率模型将360p视频转换为1080p视频 | | | [203-meter-reader](notebooks/203-meter-reader/)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?labpath=notebooks%2F203-meter-reader%2F203-meter-reader.ipynb) | PaddlePaddle预训练模型读取工业表计数据 | | -|[204-segmenter-semantic-segmentation](notebooks/204-segmenter-semantic-segmentation/)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/204-segmenter-semantic-segmentation/204-segmenter-semantic-segmentation.ipynb) | 基于OpenVINO使用Segmenter的语义分割™ | | +|[204-segmenter-semantic-segmentation](notebooks/204-segmenter-semantic-segmentation/)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/204-segmenter-semantic-segmentation/204-segmenter-semantic-segmentation.ipynb) | 基于OpenVINO使用Segmenter的语义分割™ | | | [205-vision-background-removal](notebooks/205-vision-background-removal/)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F205-vision-background-removal%2F205-vision-background-removal.ipynb)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/205-vision-background-removal/205-vision-background-removal.ipynb) | 使用显著目标检测移除并替换图像中的背景 | | | [206-vision-paddlegan-anime](notebooks/206-vision-paddlegan-anime/)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/206-vision-paddlegan-anime/206-vision-paddlegan-anime.ipynb) | 使用GAN把图片变为动画效果 | | | [207-vision-paddlegan-superresolution](notebooks/207-vision-paddlegan-superresolution/)
| 使用PaddleGAN模型以超分辨率放大小图像| | @@ -162,10 +162,10 @@ Jupyter notebooks 分为四个大类,选择一个跟你需求相关的开始 | [224-3D-segmentation-point-clouds](notebooks/224-3D-segmentation-point-clouds/)
| 使用OpenVINO处理点云数据并进行3D分割 | | | [225-stable-diffusion-text-to-image](notebooks/225-stable-diffusion-text-to-image)
| 用Stable Diffusion由文本生成图像 | | | [226-yolov7-optimization](notebooks/226-yolov7-optimization/)
| 使用NNCF PTQ API优化YOLOv7 | | -| [227-whisper-subtitles-generation](notebooks/227-whisper-subtitles-generation/)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/227-whisper-subtitles-generation/227-whisper-subtitles-generation.ipynb) | 利用OpenAI Whisper及OpenVINO为视频生成字幕 | | +| [227-whisper-subtitles-generation](notebooks/227-whisper-subtitles-generation/)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/227-whisper-subtitles-generation/227-whisper-convert.ipynb) | 利用OpenAI Whisper及OpenVINO为视频生成字幕 | | | [228-clip-zero-shot-image-classification](notebooks/228-clip-zero-shot-image-classification)
|利用CLIP及OpenVINO进行零样本图像分类 | | | [229-distilbert-sequence-classification](notebooks/229-distilbert-sequence-classification/)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?labpath=notebooks%2F229-distilbert-sequence-classification%2F229-distilbert-sequence-classification.ipynb) | 利用OpenVINO进行句子分类 | | -| [230-yolov8-optimization](notebooks/230-yolov8-optimization/)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/230-yolov8-optimization/230-yolov8-optimization.ipynb) | 使用NNCF PTQ API优化YOLOv8 | | +| [230-yolov8-optimization](notebooks/230-yolov8-optimization/)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/230-yolov8-optimization/230-yolov8-object-detection.ipynb) | 使用NNCF PTQ API优化YOLOv8 | | |[231-instruct-pix2pix-image-editing](notebooks/231-instruct-pix2pix-image-editing/)
| 利用InstructPix2Pix进行图像编辑 | | |[232-clip-language-saliency-map](notebooks/232-clip-language-saliency-map/)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/232-clip-language-saliency-map/232-clip-language-saliency-map.ipynb) | 基于CLIP和OpenVINO™的视觉语言显著性检测 | | |[233-blip-visual-language-processing](notebooks/233-blip-visual-language-processing/)
| 基于BLIP和OpenVINO™的视觉问答与图片注释 | | diff --git a/notebooks/102-pytorch-to-openvino/README.md b/notebooks/102-pytorch-to-openvino/README.md index 4a9aed960ba..12484b632b6 100644 --- a/notebooks/102-pytorch-to-openvino/README.md +++ b/notebooks/102-pytorch-to-openvino/README.md @@ -16,7 +16,7 @@ This tutorial demonstrates how to convert PyTorch models to OpenVINO Intermediat [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/102-pytorch-to-openvino/102-pytorch-onnx-to-openvino.ipynb) ![segmentation result](https://user-images.githubusercontent.com/29454499/203723317-1716e3ca-b390-47e1-bb98-07b4d8d097a0.png) -The notebook uses OpenVINO Model Converter (OVC) to convert the open-source Lite-RASPP semantic segmentation model with a MobileNet V3 Large backbone from [torchvision](https://pytorch.org/vision/main/models/lraspp.html), trained on [COCO](https://cocodataset.org) dataset images using 20 categories that are present in the [Pascal VOC](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/index.html) dataset, to OpenVINO IR. It also shows how to do segmentation inference on an image, using [OpenVINO Runtime](https://docs.openvino.ai/nightly/openvino_docs_OV_UG_OV_Runtime_User_Guide.html) and compares the results of the PyTorch model with the OpenVINO IR model. +The notebook uses OpenVINO Model Converter (OVC) to convert the open-source Lite-RASPP semantic segmentation model with a MobileNet V3 Large backbone from [torchvision](https://pytorch.org/vision/main/models/lraspp.html), trained on [COCO](https://cocodataset.org) dataset images using 20 categories that are present in the [Pascal VOC](https://paperswithcode.com/dataset/pascal-voc) dataset, to OpenVINO IR. It also shows how to do segmentation inference on an image, using [OpenVINO Runtime](https://docs.openvino.ai/nightly/openvino_docs_OV_UG_OV_Runtime_User_Guide.html) and compares the results of the PyTorch model with the OpenVINO IR model. ## Installation Instructions diff --git a/notebooks/109-performance-tricks/README.md b/notebooks/109-performance-tricks/README.md index 63fd775ae09..cc6765892bd 100644 --- a/notebooks/109-performance-tricks/README.md +++ b/notebooks/109-performance-tricks/README.md @@ -9,7 +9,7 @@ In this notebook, we’ll show a set of performance tricks for optimizing infere 1. [Performance tricks in OpenVINO for latency mode](109-latency-tricks.ipynb) -[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/109-performance-tricks\109-latency-tricks.ipynb) +[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/109-performance-tricks/109-latency-tricks.ipynb) This notebook demonstrates how to optimize the inference latency in OpenVINO™. A set of optimization tricks, including model conversion with different data precision, “AUTO” device with latency mode, shared memory, inference with a further configuration, inference on GPU, etc., are introduced. @@ -17,7 +17,7 @@ This notebook demonstrates how to optimize the inference latency in OpenVINO™. 2. [Performance tricks in OpenVINO for throughput mode](109-throughput-tricks.ipynb) -[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/109-performance-tricks\109-throughput-tricks.ipynb) +[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/109-performance-tricks/109-throughput-tricks.ipynb) This notebook demonstrates how to optimize the inference throughput in OpenVINO™. A set of optimization tricks, including bigger batch size, “AUTO” device with throughput and cumulative throughput mode, asynchronous inference mode, etc., are introduced. diff --git a/notebooks/204-segmenter-semantic-segmentation/README.md b/notebooks/204-segmenter-semantic-segmentation/README.md index 29979c12119..79d107915dd 100644 --- a/notebooks/204-segmenter-semantic-segmentation/README.md +++ b/notebooks/204-segmenter-semantic-segmentation/README.md @@ -1,6 +1,6 @@ # Semantic Segmentation with OpenVINO™ using Segmenter -[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/204-segmenter-semantic-segmentation/204-segmenter-semantic-segmentation.ipynb) +[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/204-segmenter-semantic-segmentation/204-segmenter-semantic-segmentation.ipynb) This notebook demonstrates how to convert and use [Segmenter](https://github.com/rstrudel/segmenter) PyTorch model with OpenVINO. diff --git a/notebooks/266-speculative-sampling/README.md b/notebooks/266-speculative-sampling/README.md index 0025df1705d..a1abd450294 100644 --- a/notebooks/266-speculative-sampling/README.md +++ b/notebooks/266-speculative-sampling/README.md @@ -1,7 +1,7 @@ # Text Generation via Speculative Sampling, KV Caching, and OpenVINO™ -[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/265-speculative-sampling/265-speculative-sampling.ipynb) +[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/266-speculative-sampling/266-speculative-sampling.ipynb) As model sizes grow, Generative AI implementations require significant inference resources. This not only increases the cost per generation from a prompt, but also increases the power consumption used to serve such requests.