<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Bindupautra Jyotibrat</title>
    <description>The latest articles on Forem by Bindupautra Jyotibrat (@bindupautra_jyotibrat).</description>
    <link>https://forem.com/bindupautra_jyotibrat</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1725236%2F1c3c8ccf-ec01-45b2-b170-78215555e766.jpg</url>
      <title>Forem: Bindupautra Jyotibrat</title>
      <link>https://forem.com/bindupautra_jyotibrat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bindupautra_jyotibrat"/>
    <language>en</language>
    <item>
      <title>Building an AI Floor Planner with Google Gemini and Matplotlib</title>
      <dc:creator>Bindupautra Jyotibrat</dc:creator>
      <pubDate>Wed, 04 Mar 2026 10:44:36 +0000</pubDate>
      <link>https://forem.com/bindupautra_jyotibrat/building-an-ai-floor-planner-with-google-gemini-and-matplotlib-5c5d</link>
      <guid>https://forem.com/bindupautra_jyotibrat/building-an-ai-floor-planner-with-google-gemini-and-matplotlib-5c5d</guid>
      <description>&lt;h2&gt;
  
  
  Building an AI Floor Planner with Google Gemini
&lt;/h2&gt;

&lt;h2&gt;
  
  
  What I Built with Google Gemini
&lt;/h2&gt;

&lt;p&gt;Designing &lt;strong&gt;&lt;em&gt;floor plans&lt;/em&gt;&lt;/strong&gt; usually requires architectural tools or manual drawing. I wanted to explore whether natural language could be used to generate a basic floor layout automatically.&lt;/p&gt;

&lt;p&gt;So I built an &lt;strong&gt;&lt;em&gt;AI-powered Floor Planning system&lt;/em&gt;&lt;/strong&gt; that converts a simple text prompt into a structured floor plan visualization.&lt;/p&gt;

&lt;h3&gt;
  
  
  The workflow is simple:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The user provides a natural language prompt describing a floor layout.&lt;br&gt;
Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"A 2 bedroom apartment with a living room, kitchen, and bathroom."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The prompt is sent to the Google Gemini API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Gemini parses the prompt and converts it into a structured JSON layout containing room names, dimensions, and positions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This JSON data is then used by Matplotlib to programmatically draw the floor plan.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Essentially, &lt;em&gt;Gemini&lt;/em&gt; acts as the intelligent parser that converts human language into a structured format that the program can visualize.&lt;/p&gt;

&lt;p&gt;Without an &lt;em&gt;LLM&lt;/em&gt;, writing a rule-based parser for every possible description would be extremely difficult. &lt;em&gt;Gemini&lt;/em&gt; makes this step far more flexible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;The pipeline of the system looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Prompt
     ↓
Google Gemini API
     ↓
Structured JSON Layout
     ↓
Python Processing
     ↓
Matplotlib Visualization
     ↓
Generated Floor Plan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This project is implemented in &lt;strong&gt;Python&lt;/strong&gt; inside a &lt;strong&gt;Jupyter Notebook&lt;/strong&gt;, where the &lt;em&gt;Gemini API&lt;/em&gt; generates the layout &lt;em&gt;JSON&lt;/em&gt; and &lt;em&gt;Matplotlib&lt;/em&gt; plots the rooms accordingly.&lt;/p&gt;

&lt;p&gt;The goal of this prototype was to demonstrate how LLMs can act as a bridge between human language and structured spatial data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;p&gt;This project combines &lt;strong&gt;Large Language Models with traditional Python visualization tools&lt;/strong&gt; to generate floor plans from natural language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technologies used:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google Gemini API&lt;/strong&gt; – Parses natural language prompts and converts them into structured JSON layouts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python&lt;/strong&gt; – Core programming language used to build the system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Matplotlib&lt;/strong&gt; – Used to visualize the floor plan by plotting rooms as geometric shapes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jupyter Notebook&lt;/strong&gt; – Used for development, experimentation, and running the pipeline interactively.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This combination allows the system to bridge &lt;strong&gt;natural language understanding (Gemini)&lt;/strong&gt; with &lt;strong&gt;programmatic visualization (Matplotlib)&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Example prompt:&lt;/p&gt;

&lt;p&gt;Generate a small apartment floor plan layout.&lt;/p&gt;

&lt;p&gt;Requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 Living Room near the entrance&lt;/li&gt;
&lt;li&gt;2 Bedrooms on the right side of the layout&lt;/li&gt;
&lt;li&gt;1 Kitchen connected to the living room&lt;/li&gt;
&lt;li&gt;1 Bathroom located near the bedrooms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gemini converts the description into structured JSON like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"rooms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Living Room"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"x"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"y"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"width"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"height"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Kitchen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"x"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"y"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"width"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"height"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bedroom 1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"x"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"y"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"width"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"height"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bedroom 2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"x"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"y"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"width"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"height"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bathroom"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"x"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"y"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"width"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"height"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using this &lt;em&gt;JSON&lt;/em&gt;, &lt;em&gt;Matplotlib&lt;/em&gt; plots the layout automatically, generating a visual floor plan.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5keomv5bdw9cuprl85nt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5keomv5bdw9cuprl85nt.png" alt="AI-generated apartment floor plan created using Google Gemini and Matplotlib" width="795" height="682"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The full implementation is available in the &lt;a href="https://github.com/Jyotibrat/HackByte-3.0/blob/main/Notebooks/Gemini%20with%20Matplotlib%20Model/dynamic_floor_planner_ipynb%20API.ipynb" rel="noopener noreferrer"&gt;&lt;strong&gt;Jupyter Notebook&lt;/strong&gt;&lt;/a&gt; used for this project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;Working on this project helped me understand several interesting aspects of LLM-powered systems.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;LLMs as Structured Data Generators&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One of the biggest takeaways was how effectively Gemini can convert natural language into structured formats like JSON. Instead of building complex parsers, the model can interpret spatial descriptions and organize them logically.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Prompt Engineering Matters&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Small prompt adjustments significantly affected the output format. Clear instructions like "Return the output strictly in &lt;em&gt;JSON&lt;/em&gt; format with coordinates and dimensions" made the system much more reliable.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;LLM + Traditional Programming is Powerful&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Gemini handled the semantic understanding, while &lt;strong&gt;Python&lt;/strong&gt; handled the visualization and computation. Combining LLMs with traditional libraries like Matplotlib opens up many creative possibilities.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;AI Can Simplify Design Interfaces&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Projects like this hint at a future where architectural tools or design software could be controlled using natural language instead of complex UI tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Worked Well
&lt;/h2&gt;

&lt;p&gt;Gemini worked very well for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Converting natural language prompts into structured JSON&lt;/li&gt;
&lt;li&gt;Understanding spatial relationships between rooms&lt;/li&gt;
&lt;li&gt;Following formatting instructions when prompted clearly&lt;/li&gt;
&lt;li&gt;The model was also flexible enough to interpret different ways of describing layouts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where I Faced Friction
&lt;/h2&gt;

&lt;p&gt;One challenge was ensuring consistent &lt;em&gt;JSON&lt;/em&gt; formatting. Sometimes the response included extra text or formatting issues. This required refining the prompt to enforce strict &lt;em&gt;JSON&lt;/em&gt; output.&lt;/p&gt;

&lt;p&gt;Another limitation was that the &lt;em&gt;model&lt;/em&gt; sometimes generated room overlaps or unrealistic layouts, which suggests that adding rule-based validation could improve the system.&lt;/p&gt;

&lt;p&gt;Overall, building this project showed how &lt;em&gt;powerful LLMs&lt;/em&gt; like &lt;strong&gt;Google Gemini&lt;/strong&gt; can be when used as a structured reasoning engine rather than just a chatbot.&lt;/p&gt;

&lt;p&gt;Using natural language to generate floor plans is just one example — but the same approach could be applied to many design, planning, or visualization problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Jyotibrat/HackByte-3.0" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;Project Repository&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hack-byte-3-0.vercel.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;Project Website (Frontend Demo)&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: The backend for the project is not currently deployed, so some functionality on the website may not work. The site is intended to showcase the project architecture and design.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://github.com/Jyotibrat/A-State-of-Art-Survey-on-Generative-AI-Techniques-for-Floor-Planning" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;Survey Paper&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>devchallenge</category>
      <category>geminireflections</category>
      <category>gemini</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
