Skip to content

Commit 8e88a9a

Browse files
Update notebook links in docs to point to docs version (#2155)
Co-authored-by: Sam Freund <[email protected]>
1 parent 7cb3b7a commit 8e88a9a

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

docs/source/conf.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,29 @@
2121
copyright = "2024, PhotonVision"
2222
author = "Banks Troutman, Matt Morley"
2323

24+
# -- Git configuration -----------------------------------------------------
25+
import subprocess
26+
27+
try:
28+
# Use closest tag
29+
git_tag_ref = (
30+
subprocess.check_output(
31+
[
32+
"git",
33+
"describe",
34+
"--tags",
35+
],
36+
stderr=subprocess.DEVNULL,
37+
)
38+
.strip()
39+
.decode()
40+
)
41+
except subprocess.CalledProcessError:
42+
# Couldn't find closest tag, fallback to main
43+
git_tag_ref = "main"
44+
45+
myst_substitutions = {"git_tag_ref": git_tag_ref}
46+
2447
# -- General configuration ---------------------------------------------------
2548

2649
# Add any Sphinx extension module names here, as strings. They can be
@@ -158,4 +181,4 @@ def setup(app):
158181
linkcheck_auth = [(R"https://github.com/.+", token)]
159182

160183
# MyST configuration (https://myst-parser.readthedocs.io/en/latest/configuration.html)
161-
myst_enable_extensions = ["colon_fence"]
184+
myst_enable_extensions = ["colon_fence", "substitution"]

docs/source/docs/objectDetection/opi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ PhotonVision currently ONLY supports 640x640 Ultralytics YOLOv5, YOLOv8, and YOL
1414
Only quantized models are supported, so take care when exporting to select the option for quantization.
1515
:::
1616

17-
PhotonVision now ships with a [Python Notebook](https://github.com/PhotonVision/photonvision/blob/main/scripts/rknn-convert-tool/rknn_conversion.ipynb) that you can use in [Google Colab](https://colab.research.google.com) or in a local environment. In Google Colab, you can simply paste the PhotonVision GitHub URL into the "GitHub" tab and select the `rknn_conversion.ipynb` notebook without needing to manually download anything.
17+
PhotonVision now ships with a {{ '[Python Notebook](https://github.com/PhotonVision/photonvision/blob/{}/scripts/rknn-convert-tool/rknn_conversion.ipynb)'.format(git_tag_ref) }} that you can use in [Google Colab](https://colab.research.google.com) or in a local environment. In Google Colab, you can simply paste the PhotonVision GitHub URL into the "GitHub" tab and select the `rknn_conversion.ipynb` notebook without needing to manually download anything.
1818

1919
Please ensure that the model you are attempting to convert is among the {ref}`supported models <docs/objectDetection/opi:Supported Models>` and using the PyTorch format.

docs/source/docs/objectDetection/rubik.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PhotonVision currently ONLY supports 640x640 Ultralytics YOLOv8 and YOLOv11 mode
1414
Only quantized models are supported, so take care when exporting to select the option for quantization.
1515
:::
1616

17-
PhotonVision now ships with a [Python Notebook](https://github.com/PhotonVision/photonvision/blob/main/scripts/rubik_conversion.ipynb) that you can use in [Google Colab](https://colab.research.google.com) or in a local environment. In Google Colab, you can simply paste the PhotonVision GitHub URL into the "GitHub" tab and select the `rubik_conversion.ipynb` notebook without needing to manually download anything.
17+
PhotonVision now ships with a {{ '[Python Notebook](https://github.com/PhotonVision/photonvision/blob/{}/scripts/rubik_conversion.ipynb)'.format(git_tag_ref) }} that you can use in [Google Colab](https://colab.research.google.com) or in a local environment. In Google Colab, you can simply paste the PhotonVision GitHub URL into the "GitHub" tab and select the `rubik_conversion.ipynb` notebook without needing to manually download anything.
1818

1919
Please ensure that the model you are attempting to convert is among the {ref}`supported models <docs/objectDetection/rubik:Supported Models>` and using the PyTorch format.
2020

0 commit comments

Comments
 (0)