Spaces:
Sleeping
Sleeping
Commit History
2 days ago
-
Update dependencies and fix runtime bugs found in audit
Dependencies - Pin Streamlit 1.67.0 and Python 3.12 via README sdk_version/python_version - Update all packages to current releases (pandas 3.1, numpy 2.5, plotly 7.1, PyMuPDF 2.1, Pillow 13, OpenCV 5, reportlab 5.1, google-genai 3.1, firebase-admin 7.7, Document AI 3.17) - Remove unused packages: langchain, langchain-core, langchain-community, langchain-google-genai, langsmith, google-generativeai (deprecated), fpdf2, imageio, python-docx, python-dotenv, pyyaml - Add beautifulsoup4 (used for HTML table parsing) and packages.txt with tesseract-ocr so the Tesseract OCR fallback works on Spaces Streamlit API - Replace deprecated use_container_width=True with width="stretch" (136 calls) - Replace deprecated st.components.v1.html with st.iframe via embed_html helper Bug fixes - CropDrive parent-window listener script had a JS syntax error (doubled braces in a non f-string), so language/config messages were never handled - OCR: missing `io` import broke PDF-to-image conversion…3f62288
-
Improve OCR structured parsing for soil and leaf reports
Mark CuizonRestore table/text scoring merge, SP Lab ID handling, and sliding-window alignment so structured OCR matches real lab layouts instead of shifted columns.7bf95c0 -
Simplify OCR structured JSON and fix results metadata display
Mark CuizonStreamline upload OCR sample formatting and structured JSON extraction. Fix seasonal datetime usage and stop filtering core step metadata fields from results UI.abdb5ed
-
fix: parse SP Lab vertical OCR layout for accurate soil structured data
Mark CuizonAdd column-major vertical Document AI parser for SP Lab reports (parameter label then one value per sample line). Fix Total P/Available P digits being skipped as column indices. Verified exact match on all 10 samples from user OCR including N.D.e400cff -
fix: structured OCR follows raw tables/text for soil and leaf
Mark CuizonPrefer header-mapped Document AI/Excel tables over shifted positional text parses. Sliding-window alignment fixes leaf N/P column shifts and soil leading junk. Flatten nested leaf Dry Matter structures; preserve SP Lab sample IDs.cf264e0 -
fix: SP Lab structured OCR pH from real raw text (transposed layout + leading junk)
Mark CuizonParse column-major SP Lab reports (samples as columns, params as rows). Align first soil value to realistic pH range so lab serial numbers are not used as pH. Prefer raw-text values over tables; never use hardcoded samples.d68f8af -
fix: parse SP Lab OCR from real text and restore Gemini analysis
Mark CuizonRemove hardcoded SP Lab sample values so structured OCR matches raw OCR (including pH). Resolve Gemini API keys from common HF secret names and use valid models with probe verification instead of gemini-3.1 fallback-only runs.5cac7b6
-
fix: restore Hugging Face Space build and startup reliability
Mark Cuizon- Remove spellchecker (no Linux wheel) and unused Streamlit extras that bloated installs - Relax pandas/numpy/PyMuPDF pins for Python 3.10 manylinux compatibility - Delete orphaned dead code in dashboard.py that could break fresh builds - Make Firebase initialization non-fatal so the Space stays running without secrets - Add safe Streamlit secrets helpers and remove import-time st.stop() in upload - Add .streamlit/config.toml and pin Python 3.10 in README metadatac9a0fae
-
Add Palm Tree Age input (1-35 years) and Soil Type selection to upload page
ff8c766
-
Implement upload limit enforcement - block upload page access and disable buttons when limit reached
8d42b2b
-
Fix Step 6 errors and analysis limit enforcement - Fix 'str' object has no attribute 'get' error in forecast graph - Fix interpretations and key_findings display formatting issues - Fix analysis limit check order to use updated session state - Add proper type validation for forecast data
197ef6c
-
Fix: Correct indentation error in upload.py
- Fixed IndentationError on line 1080 - Properly indented code block under if statement on line 1077fb295dc -
Fix: Add optimistic upload count update after ANALYSIS_COMPLETE
- Added optimistic upload count increment in Python session state before sending ANALYSIS_COMPLETE - Added optimistic update in JavaScript sessionStorage and URL params - Updated upload.py to always read from URL params (most up-to-date source) - Enhanced CONFIG message handling with logging - Added CONFIG_UPDATE handler for non-reload updates - Ensures upload count (e.g., 0/2 used) updates immediately after analysis completes - Multiple update mechanisms ensure count stays in syncddd3171 -
Fix upload limit calculation logic
- Calculate uploads_remaining as uploads_limit - uploads_used instead of trusting parent value - Fix can_start_analysis() to recalculate remaining for accuracy - Fix display to show correct remaining count (e.g., 0/2 used = 2 remaining, not 0) - Ensure limit is only reached when uploads_used >= uploads_limit82b42ca -
Add CropDrive integration: upload limits enforcement and analysis completion messaging
- Update cropdrive_integration.py to handle CONFIG messages with upload limits - Add can_start_analysis() function to check upload limits before analysis - Add get_upload_limit_info() helper function - Update send_analysis_complete() to include ISO timestamp - Update upload.py to enforce upload limits before allowing analysis - Display upload usage information on upload page - Update results.py to ensure ANALYSIS_COMPLETE message includes timestamp - Handle unlimited plans (infinity/-1) properly9d3b8a9 -
Translate Expected text in leaf upload container to Malaysian
0ca34e9 -
Translate Land Size, Current Yield, Yield Unit, and Palm Density labels in upload page to Malaysian
f3dc193 -
Translate upload page sections: Land & Yield Information, OCR Data Processing, Raw Extracted Text Data, and Structured OCR Data to Malaysian
6ba7961
-
Replace all remaining AGS AI references with CropDrive™ AI Assistant
- Updated module package comment - Updated dashboard welcome notification - Updated machine ID file path - Updated parameter standardizer comment - Updated auth utils app name defaults - Updated admin user email and company name - Updated PDF utils fallback text888355f -
Replace all AGS AI references with CropDriveTM
- Updated app title, subtitles, and copyright notices - Replaced AGS AI Assistant with CropDriveTM Assistant - Updated PDF generation system name - Updated admin account email and name - Updated machine ID file name - Updated all translation strings (English and Malaysian) - Updated README.md title8b86c19
-
clean repo
fb5dc87