Skip to content

Commit 26dc9c2

Browse files
author
Tyler Romero
committed
make sure getting-started code works
1 parent 3847d1c commit 26dc9c2

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ install: ## Install the package from source
88
poetry install
99

1010
install-extras: install ## Install the package from source with extra dependencies
11-
poetry run pip install numpy
11+
poetry run pip install numpy framegrab[youtube]
1212

1313
install-lint: ## Only install the linter dependencies
1414
poetry install --only lint
@@ -61,10 +61,10 @@ test-integ: install ## Run tests against the integ API server (needs GROUNDLIGH
6161
test-dev: install ## Run tests against a dev API server (needs GROUNDLIGHT_API_TOKEN and properly configured dns-hostmap)
6262
GROUNDLIGHT_ENDPOINT="https://api.dev.groundlight.ai/" $(MAKE) test
6363

64-
test-docs: install ## Run the example code and tests in our docs against the prod API (needs GROUNDLIGHT_API_TOKEN)
64+
test-docs: install-extras ## Run the example code and tests in our docs against the prod API (needs GROUNDLIGHT_API_TOKEN)
6565
${PYTEST} --markdown-docs ${TEST_ARGS} docs README.md
6666

67-
test-docs-integ: install ## Run the example code and tests in our docs against the integ API (needs GROUNDLIGHT_API_TOKEN)
67+
test-docs-integ: install-extras ## Run the example code and tests in our docs against the integ API (needs GROUNDLIGHT_API_TOKEN)
6868
GROUNDLIGHT_ENDPOINT="https://api.integ.groundlight.ai/" ${PYTEST} --markdown-docs ${TEST_ARGS} docs README.md
6969

7070
# Adjust which paths we lint

docs/docs/getting-started/getting-started.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,27 +63,27 @@ from groundlight import Groundlight, Detector, ImageQuery
6363
from framegrab import FrameGrabber
6464

6565
gl = Groundlight()
66-
67-
detector = gl.get_or_create_detector(detector_name, detector_query)
6866
detector: Detector = gl.get_or_create_detector(
6967
name="eagle-detector",
7068
query="Is there an eagle visible?",
7169
)
7270

71+
# Big Bear Bald Eagle Nest live-stream
72+
youtube_live_url = 'https://www.youtube.com/watch?v=B4-L2nfGcuE'
73+
7374
config = {
7475
'input_type': 'youtube_live',
75-
'id': {
76-
# Big Bear Bald Eagle Nest live-stream
77-
'youtube_url': 'https://www.youtube.com/watch?v=B4-L2nfGcuE'
78-
}
76+
'id': {'youtube_url': youtube_live_url},
7977
}
8078

81-
with FrameGrabber.create_grabber(config) as grabber:
79+
with FrameGrabber.create_grabber({
80+
'input_type': 'youtube_live', 'id': {'youtube_url': youtube_live_url},
81+
}) as grabber:
8282
frame = grabber.grab()
8383
if frame is None:
8484
raise Exception("No frame captured")
8585

86-
image_query = gl.submit_image_query(detector=det, image=frame)
86+
image_query = gl.submit_image_query(detector=detector, image=frame)
8787

8888
print(f"The answer is {image_query.result.label}")
8989
print(image_query)

0 commit comments

Comments
 (0)