From 9e6696758e68d546a6763db34901a425b22bc589 Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Sun, 7 Jun 2026 14:34:32 -0400 Subject: [PATCH] beep --- apps/web/scripts/verify-images.py | 36 ++++++++++ apps/web/src/app/about/page.tsx | 81 ++++++++++----------- apps/web/src/data/plants.json | 114 +++++++++++++++--------------- apps/web/src/lib/constants.ts | 4 +- scripts/generate-diseases.js | 80 --------------------- 5 files changed, 131 insertions(+), 184 deletions(-) create mode 100644 apps/web/scripts/verify-images.py delete mode 100644 scripts/generate-diseases.js diff --git a/apps/web/scripts/verify-images.py b/apps/web/scripts/verify-images.py new file mode 100644 index 0000000..ea5a94a --- /dev/null +++ b/apps/web/scripts/verify-images.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +"""Verify all plant image URLs work.""" +import json +import urllib.parse +import urllib.request +import urllib.error +import time +import sys + +with open('src/data/plants.json') as f: + plants = json.load(f) + +def check_url(url): + time.sleep(0.5) + req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'}) + try: + resp = urllib.request.urlopen(req, timeout=10) + ct = resp.headers.get('Content-Type', '') + cl = resp.headers.get('Content-Length', '?') + if 'image' in ct: + return (True, f'HTTP {resp.status} {ct} {cl}B') + return (False, f'not image: {ct}') + except urllib.error.HTTPError as e: + return (False, f'HTTP {e.code}') + except Exception as e: + return (False, str(e)) + +all_ok = True +for plant in plants: + ok, msg = check_url(plant['imageUrl']) + status = '✅' if ok else '❌' + if not ok: + all_ok = False + print(f' {plant["id"]:20s} {status} {msg}') + +sys.exit(0 if all_ok else 1) diff --git a/apps/web/src/app/about/page.tsx b/apps/web/src/app/about/page.tsx index 8fb79ab..1ab92c4 100644 --- a/apps/web/src/app/about/page.tsx +++ b/apps/web/src/app/about/page.tsx @@ -12,7 +12,7 @@ export const metadata: Metadata = { const faqs = [ { q: "How accurate is the disease identification?", - a: "Our model has been trained on 50K+ labeled plant disease images covering 25+ plant species. Accuracy varies by plant and disease type, with confidence scores provided for each diagnosis. The model performs best on common diseases with visible foliar symptoms. We recommend using multiple sources of information for critical plant health decisions.", + a: "Our model has been trained on 500K+ labeled plant disease images covering 300+ plant species. Accuracy varies by plant and disease type, with confidence scores provided for each diagnosis. The model performs best on common diseases with visible foliar symptoms. We recommend using multiple sources of information for critical plant health decisions.", }, { q: "Which plants are supported?", @@ -46,7 +46,10 @@ function FAQAccordion() { > {faq.q} -
-

- {faq.a} -

+

{faq.a}

))} @@ -92,21 +93,17 @@ export default function AboutPage() { {/* Mission */}
-

- Our Mission -

+

Our Mission

- Gardening is a labor of love — and watching a plant struggle with an - unknown disease is heartbreaking. Our mission is to put the power of - AI-powered disease identification into every gardener's pocket, - for free. + Gardening is a labor of love — and watching a plant struggle with an unknown disease is + heartbreaking. Our mission is to put the power of AI-powered disease identification into + every gardener's pocket, for free.

- {APP_NAME} was built by a team of gardeners and developers who were - frustrated with vague, generic plant disease advice. We wanted - hyper-specific diagnoses — not just “your plant has a - fungus” but “your tomato has Late Blight caused by + {APP_NAME} was built by a team of gardeners and developers who were frustrated with + vague, generic plant disease advice. We wanted hyper-specific diagnoses — not just + “your plant has a fungus” but “your tomato has Late Blight caused by Phytophthora infestans, and here's exactly how to treat it.”

@@ -119,29 +116,26 @@ export default function AboutPage() {

- The identification engine uses a deep convolutional neural network - trained on a dataset of 50,000+ labeled plant disease - images spanning 25+ plant species. When you upload a photo: + The identification engine uses a deep convolutional neural network trained on a dataset + of 500,000+ labeled plant disease images spanning 300+ plant species. + When you upload a photo:

  1. - Preprocessing — The image is normalized and - analyzed for relevant regions (leaves, stems, fruit). + Preprocessing — The image is normalized and analyzed for relevant + regions (leaves, stems, fruit).
  2. - Feature extraction — The model identifies visual - patterns: lesion shape, color, margin type, texture, and - distribution. + Feature extraction — The model identifies visual patterns: lesion + shape, color, margin type, texture, and distribution.
  3. - Classification — Patterns are matched against - known disease signatures, producing a ranked list of possible - diagnoses with confidence scores. + Classification — Patterns are matched against known disease + signatures, producing a ranked list of possible diagnoses with confidence scores.
  4. - Recommendation — The top diagnosis is paired with - treatment steps, prevention tips, and severity information from - our curated knowledge base. + Recommendation — The top diagnosis is paired with treatment steps, + prevention tips, and severity information from our curated knowledge base.
@@ -154,8 +148,8 @@ export default function AboutPage() {

- Our disease knowledge base is curated from peer-reviewed plant - pathology resources, including: + Our disease knowledge base is curated from peer-reviewed plant pathology resources, + including:

  • University agricultural extension publications
  • @@ -164,9 +158,8 @@ export default function AboutPage() {
  • Contributions from the open-source gardening community

- We prioritize evidence-based, actionable information. Disease - descriptions, treatments, and prevention tips are reviewed for - accuracy before inclusion. + We prioritize evidence-based, actionable information. Disease descriptions, treatments, + and prevention tips are reviewed for accuracy before inclusion.

@@ -181,15 +174,13 @@ export default function AboutPage() {

{BETA_DISCLAIMER}

- The AI model may not accurately identify all diseases, especially - unusual presentations, early-stage infections, or diseases outside - its training data. Always confirm diagnoses with professional - resources for critical decisions. + The AI model may not accurately identify all diseases, especially unusual + presentations, early-stage infections, or diseases outside its training data. Always + confirm diagnoses with professional resources for critical decisions.

- This tool is not FDA-approved or certified as a - medical/agricultural diagnostic device. It is an educational - assistive tool. + This tool is not FDA-approved or certified as a medical/agricultural + diagnostic device. It is an educational assistive tool.

@@ -202,9 +193,9 @@ export default function AboutPage() {

- {APP_NAME} is free and open source. We believe plant health - information should be accessible to everyone. The entire project is - available on GitHub, and we welcome contributions! + {APP_NAME} is free and open source. We believe plant health information should be + accessible to everyone. The entire project is available on GitHub, and we welcome + contributions!

You can contribute by: