Skip to content

Room makeover plan generation#1

Draft
snehala24 wants to merge 1 commit intomainfrom
cursor/room-makeover-plan-generation-93db
Draft

Room makeover plan generation#1
snehala24 wants to merge 1 commit intomainfrom
cursor/room-makeover-plan-generation-93db

Conversation

@snehala24
Copy link
Owner

@snehala24 snehala24 commented Jul 30, 2025

Implement a comprehensive AI-powered room makeover system with enhanced object detection, LLM-driven design suggestions, and e-commerce integration.


Open in Cursor Open in Web

Learn more about Cursor Agents

Summary by Sourcery

Provide a comprehensive AI-powered room makeover solution by overhauling the documentation, enhancing the Streamlit frontend, introducing a FastAPI backend, enriching object detection and design planning logic, and integrating multi-platform e-commerce support.

New Features:

  • Add FastAPI API with /makeover, /styles, and /health endpoints alongside the Streamlit application
  • Integrate multi-platform e-commerce search links (Amazon, Flipkart, Pepperfry, Urban Ladder) into suggested items
  • Define and support seven distinct interior design styles with detailed guides for each

Enhancements:

  • Revamp Streamlit UI with custom CSS, sidebar style guide, two-column layout, metrics and interactive components
  • Improve image processing to count objects, classify room type, and generate richer room descriptions
  • Extend LLM prompt structure to include style guidance, real-world pricing, JSON parsing, and automatic product link generation
  • Refactor pipeline to pass detailed detection results into the makeover planner
  • Add setup.py script to automate environment setup and sample structure creation

Documentation:

  • Completely overhaul README with project overview, key features, supported styles, API documentation, installation instructions and usage examples

Tests:

  • Add test_system.py for end-to-end pipeline validation using sample images

…s, and UI

Co-authored-by: nilasnehala2417 <nilasnehala2417@gmail.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Jul 30, 2025

Reviewer's Guide

This PR delivers a full AI-powered room makeover system by overhauling documentation, frontend UI, LLM prompting, object detection logic, and adding a FastAPI backend with setup and testing scripts for a streamlined development and user experience.

Sequence diagram for the new API-based makeover plan generation

sequenceDiagram
    actor User
    participant Frontend
    participant FastAPI as API Backend
    participant Pipeline
    participant ImageProcessor
    participant LLMSuggester

    User->>Frontend: Uploads image, selects style & budget
    Frontend->>API Backend: POST /makeover (image, budget, style)
    API Backend->>Pipeline: image_to_makeover(image_path, budget, style)
    Pipeline->>ImageProcessor: detect_objects(image_path)
    ImageProcessor-->>Pipeline: detection_result
    Pipeline->>ImageProcessor: generate_room_description(detection_result)
    ImageProcessor-->>Pipeline: room_description
    Pipeline->>LLMSuggester: get_makeover_plan(room_description, detection_result, budget, style)
    LLMSuggester-->>Pipeline: llm_response
    Pipeline-->>API Backend: result (room_description, detection_result, llm_response)
    API Backend-->>Frontend: JSON response
    Frontend-->>User: Displays analysis, suggestions, shopping links
Loading

Class diagram for enhanced object detection and LLM suggestion modules

classDiagram
    class ImageProcessor {
        +detect_objects(image_path: str) dict
        +generate_room_description(detection_result: dict) str
        INDOOR_OBJECTS
        ROOM_INDICATORS
    }
    class LLMSuggester {
        +get_makeover_plan(room_description: str, detection_result: dict, budget: int, style: str) dict
        +get_style_guide(style: str) str
        +generate_product_links(items: list) list
        STYLE_GUIDES
        ECOMMERCE_PLATFORMS
    }
    class Pipeline {
        +image_to_makeover(image_path: str, budget: int, style: str) dict
    }
    ImageProcessor <.. Pipeline : uses
    LLMSuggester <.. Pipeline : uses
Loading

File-Level Changes

Change Details Files
Expanded documentation and project setup
  • Restructured README with detailed feature overview, tech stack, API docs, and usage examples
  • Added setup.py script for automated environment and dependency setup
  • Introduced test_system.py for end-to-end pipeline validation
README.md
setup.py
test_system.py
Revamped Streamlit frontend
  • Injected custom CSS for headers, cards, and buttons
  • Reorganized layout into sidebar and two columns
  • Enhanced upload, budget, style inputs and result metrics display
  • Styled item cards with shopping links and footer
streamlit_app.py
Enhanced LLM prompt and suggestion logic
  • Defined comprehensive STYLE_GUIDES and ECOMMERCE_PLATFORMS for Indian market
  • Updated prompt template to include detected objects, style guidance, and JSON schema
  • Added JSON parsing, raw_output retention, and generate_product_links function
app/llm_suggester.py
Improved object detection and room analysis
  • Expanded INDOOR_OBJECTS taxonomy and confidence filtering
  • Implemented classify_room_type to infer room category
  • Enhanced generate_room_description to include counts and context
app/image_processor.py
New FastAPI backend integration
  • Created FastAPI app with CORS, metadata, and health endpoint
  • Added /styles and /makeover endpoints with input validation
  • Structured JSON responses for frontend and API clients
app/main.py
Updated processing pipeline
  • Modified image_to_makeover to use enriched detection_result
  • Passed full context to get_makeover_plan and merged llm_response
app/pipeline.py
Refined project dependencies
  • Revised requirements.txt to align with new modules (requests, pandas, collections-extended)
  • Removed obsolete libraries and grouped optional scraping dependencies
requirements.txt

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants