YardAgent
YardAgent turns a photo of your backyard into a costed landscape design.
Core trick
Estimates yard dimensions from reference objects in a photo, then browses retailer sites for real-priced items to build an itemized budget.
Description
YardAgent turns a photo of your backyard into a costed landscape design. Upload one photo, set a budget, and say what you want. It estimates the yard's dimensions by finding reference objects in the image, generates a layout, then browses Amazon, Home Depot and Lowe's to source each item at real prices with real links. You get a before/after render built from your original photo, a 3D scene you can walk through, and an itemized budget that tells you the truth. Ask for a pool on $5,000 and it says you're $40,000 over rather than quietly designing something cheaper. A chat model designs your yard with invented prices; this one goes and looks them up.
README excerpt
# YardAgent
A FastAPI image upload project. Requires Python 3.10+.
## Run
```powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python -m playwright install chromium
uvicorn main:app --reload
```
Open http://127.0.0.1:8000 for the upload page or http://127.0.0.1:8000/docs
for interactive API documentation. On macOS/Linux, activate with
`source .venv/bin/activate`.
## API
`POST /analyze` accepts a multipart image field named `file`:
```powershell
curl.exe -F "file=@photo.jpg" http://127.0.0.1:8000/analyze
```
Before starting the server, set your API key in the same shell:
```powershell
$env:OPENAI_API_KEY = "your-api-key"
# Optional: choose another model supporting vision and structured outputs.
$env:OPENAI_MODEL = "gpt-4o"
# Optional: a GPT Image model supporting PNG output.
$env:OPENAI_IMAGE_MODEL = "gpt-image-2"
```
On macOS/Linux, use `export OPENAI_API_KEY="your-api-key"`.
Keep the key on the server; never put it in browser code or commit it.
The JSON response has this structure (numbers depend on the uploaded photo):
```json
{
"width_ft": { "min": 30, "max": 40 },
"length_ft": { "min": 45, "max": 60 },
"area_sq_ft": { "min": 1350, "max": 2400 },
"reference_object": {
"object": "Fence panel",
"assumed_dimension": "width",
"size_ft": { "min": 6, "max": 8 },
"reasoning": "No usable standard door is visible; a fence panel provides an approximate scale."
},
"confidence": "low",
"visi