MCPcopy Index your code
hub / github.com/GrantCuster/gemini-spatial-example

github.com/GrantCuster/gemini-spatial-example @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
26 symbols 63 edges 17 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Gemini spatial example

Screen recording of the demo

A cool thing about current Gemini models is that they can give bounding box information. This repo shows how to prompt and display bounding box info (there are some tricks). It's meant as a demonstrations and for other developers to build on. It uses vite-express with a minimal server to access the API.

Normalization

If you're looking to make your own application. Keep in mind that gemini returns coordinates normalize to 1000x1000. It also better when using the coordinate order in the example prompt. See BoundingBoxOverlay.tsx for an example of how to transform these for use in HTML and javascript.

More examples

A simpler example with a JSON prompt is available at https://github.com/GrantCuster/gemini-json-bounding-box-example.

Running

To run locally (the only way to run it currently). Put your Gemini API Key (get from https://ai.google.dev/) into the example.env file and rename to .env. Use npm install and npm run dev.

Core symbols most depended-on inside this repo

average
called by 4
src/utils.tsx
useDrawImageToCanvas
called by 3
src/hooks.tsx
drawPoints
called by 2
src/Canvas.tsx
resetTimeout
called by 2
src/Canvas.tsx
useSaveCanvasToLocalStorage
called by 2
src/hooks.tsx
predictImage
called by 1
src/modelUtils.tsx
useHandleDragAndDropImage
called by 1
src/hooks.tsx
getSvgPathFromStroke
called by 1
src/utils.tsx

Shape

Function 26

Languages

TypeScript100%

Modules by API surface

src/hooks.tsx6 symbols
src/Canvas.tsx6 symbols
src/utils.tsx5 symbols
src/MardownResponse.tsx4 symbols
src/BoundingBoxOverlay.tsx2 symbols
src/modelUtils.tsx1 symbols
src/ImageUploader.tsx1 symbols
src/App.tsx1 symbols

For agents

$ claude mcp add gemini-spatial-example \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact