<?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>DEV Community: Surjeet Singh</title>
    <description>The latest articles on DEV Community by Surjeet Singh (@surjeetlko).</description>
    <link>https://dev.to/surjeetlko</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%2F3791048%2F9b729bc4-2d4b-4151-8a6f-b134cc2febae.jpg</url>
      <title>DEV Community: Surjeet Singh</title>
      <link>https://dev.to/surjeetlko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/surjeetlko"/>
    <language>en</language>
    <item>
      <title>Building an AI-Powered Medicine Strip Analyzer using YOLO, EasyOCR, and the Gemini API</title>
      <dc:creator>Surjeet Singh</dc:creator>
      <pubDate>Mon, 02 Mar 2026 09:34:14 +0000</pubDate>
      <link>https://dev.to/surjeetlko/building-an-ai-powered-medicine-strip-analyzer-using-yolo-easyocr-and-the-gemini-api-52g0</link>
      <guid>https://dev.to/surjeetlko/building-an-ai-powered-medicine-strip-analyzer-using-yolo-easyocr-and-the-gemini-api-52g0</guid>
      <description>&lt;p&gt;Have you ever struggled to read the tiny, faded text on a medicine strip? Or maybe you wanted to quickly know the side effects of a pill but found the medical jargon too complex?&lt;/p&gt;

&lt;p&gt;For the Build with Google Gemini API Challenge, I decided to solve this real-world problem. I built an AI pipeline that not only reads the text from a medicine strip but also understands it and provides a clean, easy-to-read summary of the medicine's uses, ingredients, and warnings.&lt;/p&gt;

&lt;p&gt;🛠️ The Tech Stack&lt;br&gt;
YOLO (You Only Look Once): For detecting and cropping the exact location of the text on the medicine strip.&lt;/p&gt;

&lt;p&gt;EasyOCR: For extracting the raw text from the cropped image.&lt;/p&gt;

&lt;p&gt;Google Gemini API (gemini-2.5-flash): The brain of the operation. It takes the messy OCR output and structures it into meaningful medical information.&lt;/p&gt;

&lt;p&gt;Python: The glue holding it all together.&lt;/p&gt;

&lt;p&gt;🚀 How It Works&lt;br&gt;
Step 1: Text Extraction (Vision)&lt;br&gt;
First, my system uses a camera to capture the medicine strip. YOLO identifies the text regions, and EasyOCR extracts the raw characters.&lt;br&gt;
Example OCR Output: "Paracetamol Tablets IP 500mg Dolo 500 Micro Labs"&lt;/p&gt;

&lt;p&gt;Step 2: AI Comprehension (Gemini API)&lt;br&gt;
Raw OCR text is often unstructured and hard for a normal user to understand. This is where the new google-genai SDK shines. I pass this raw text to the Gemini 2.5 Flash model with a specific prompt to act as a medical assistant.&lt;/p&gt;

&lt;p&gt;Here is the core code that powers this integration:&lt;/p&gt;

&lt;p&gt;Python&lt;/p&gt;

&lt;p&gt;`from google import genai&lt;/p&gt;

&lt;h1&gt;
  
  
  Initialize the client
&lt;/h1&gt;

&lt;p&gt;client = genai.Client(api_key="YOUR_API_KEY")&lt;/p&gt;

&lt;p&gt;ocr_extracted_text = "Paracetamol Tablets IP 500mg Dolo 500 Micro Labs"&lt;/p&gt;

&lt;p&gt;prompt = f"""&lt;br&gt;
I have extracted the following text from a medicine strip using an OCR pipeline:&lt;br&gt;
'{ocr_extracted_text}'&lt;/p&gt;

&lt;p&gt;Please act as a helpful AI assistant and extract the following details from this text:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Medicine Name&lt;/li&gt;
&lt;li&gt;Active Ingredients &amp;amp; Composition&lt;/li&gt;
&lt;li&gt;Common Uses&lt;/li&gt;
&lt;li&gt;General Warnings or Side Effects&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Please keep the response well-formatted, brief, and include a standard medical disclaimer.&lt;br&gt;
"""&lt;/p&gt;

&lt;p&gt;response = client.models.generate_content(&lt;br&gt;
    model='gemini-2.5-flash',&lt;br&gt;
    contents=prompt&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;print(response.text)`&lt;/p&gt;

&lt;p&gt;Step 3: The Output&lt;br&gt;
The Gemini model processes the request instantly and returns a beautifully formatted summary.&lt;/p&gt;

&lt;p&gt;(Here is the actual output from my terminal):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Medicine Name: Dolo 500 (Brand Name), Paracetamol Tablets IP (Generic Name &amp;amp; Form)&lt;/li&gt;
&lt;li&gt;Active Ingredients &amp;amp; Composition: Paracetamol 500mg (conforming to Indian Pharmacopoeia standards)&lt;/li&gt;
&lt;li&gt;Common Uses (Inferred): Pain relief (e.g., headache, muscle aches, toothache) and fever reduction.&lt;/li&gt;
&lt;li&gt;General Warnings or Side Effects (Inferred):&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Warnings: Do not exceed the recommended dose. Overdose can cause liver damage...&lt;/p&gt;

&lt;p&gt;Common Side Effects: Nausea, stomach upset, allergic reactions...&lt;/p&gt;

&lt;p&gt;(Disclaimer: This is for informational purposes and uses AI inference, not a substitute for professional medical advice.)&lt;/p&gt;

&lt;p&gt;💡 Why Gemini 2.5 Flash?&lt;br&gt;
I chose the gemini-2.5-flash model because it is incredibly fast, which is crucial for a real-time scanning application. The updated google-genai SDK was also very straightforward to implement.&lt;/p&gt;

&lt;p&gt;🔮 What's Next?&lt;br&gt;
In the future, I plan to integrate this pipeline into a mobile app or a Raspberry Pi setup using Node-RED for automated sorting!&lt;/p&gt;

&lt;p&gt;Thanks for reading, and happy coding!&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>geminireflections</category>
      <category>gemini</category>
    </item>
    <item>
      <title>Building a Real-Time IoT Dashboard for Smart Hospitals: My Journey with Docker &amp; Python</title>
      <dc:creator>Surjeet Singh</dc:creator>
      <pubDate>Wed, 25 Feb 2026 06:32:35 +0000</pubDate>
      <link>https://dev.to/surjeetlko/building-a-real-time-iot-dashboard-for-smart-hospitals-my-journey-with-docker-python-1o32</link>
      <guid>https://dev.to/surjeetlko/building-a-real-time-iot-dashboard-for-smart-hospitals-my-journey-with-docker-python-1o32</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;: Operation Theatres (OTs) aur ICUs mein patient safety sabse zyada zaroori hoti hai. Aise critical environments mein Temperature, Humidity, aur Air Quality Index (AQI) ka thoda sa bhi fluctuation khatarnak ho sakta hai. Traditional monitoring systems slow hote hain aur unme hardware failures par data loss hone ka darr rehta hai. Is problem ko solve karne ke liye, maine haal hi mein ek &lt;strong&gt;Centralized IoT Monitoring System (BMS&lt;/strong&gt;) develop kiya, jo 100% real-time, scalable aur robust hai.&lt;/p&gt;

&lt;p&gt;Is article mein main share karunga ki kaise maine Python, Multi-threaded TCP, aur Docker ka use karke ek fail-proof architecture design kiya.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Architecture &amp;amp; Tech Stack&lt;/strong&gt; Mera primary goal ek aisi system banana tha jo kitne bhi naye sensors add hone par block na ho. Isliye maine basic tools (like Node-RED) ko side karke ek custom &lt;strong&gt;Containerized Architecture&lt;/strong&gt; banaya:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Core Backend&lt;/strong&gt;: Python&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Networking&lt;/strong&gt;: Multi-threaded TCP/IP Server&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deployment &amp;amp; Scaling&lt;/strong&gt;: Docker &amp;amp; Systemd&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Features of the System&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Real-time Monitoring &amp;amp; Alert Visualization&lt;/strong&gt;: Yeh system OTs aur ICUs se live data fetch karta hai. Isme CO2, O3, aur NO2 jaise critical gases ke sath-sath live AQI monitor hota hai. Dashboard par Green/Red status indicators lagaye gaye hain, jo device health aur danger levels ko instantly visualize karte hain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-threaded TCP Connections&lt;/strong&gt;: Jab multiple IoT devices ek sath data bhejte hain, toh single-thread system crash ho sakta hai. Isliye maine Python mein ek robust multi-threaded TCP server architect kiya. Yeh server alag-alag wards aur devices se aane wale concurrent connections ko bina kisi delay ke handle karta hai.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero Data Loss &amp;amp; Reliability&lt;/strong&gt;: Hospitals mein internet ya power fluctuation aam baat hai. Isko counter karne ke liye maine &lt;strong&gt;Auto-reconnection logic&lt;/strong&gt; aur &lt;strong&gt;Local storage buffering&lt;/strong&gt; implement ki hai. Agar connection toot bhi jaye, toh device data locally buffer karega aur reconnect hote hi server par sync kar dega.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Configuration Portal&lt;/strong&gt;: Is system ka sabse bada USP iska Setup Manager hai. Facility managers bina code touch kiye ek secure portal se naye sensors ya wards ko dynamically add aur remove kar sakte hain. New ICU setup karna ab sirf kuch seconds ka kaam hai.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why Docker?&lt;/strong&gt; Aise critical application ko server par directly run karna risky hota hai. Isliye maine is poore microservice ko &lt;strong&gt;Docker&lt;/strong&gt; par containerize kiya.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Environment Isolation:&lt;/strong&gt; Har service apne container mein run hoti hai, jisse dependency conflicts zero ho jate hain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-Healing:&lt;/strong&gt; Docker restart policies aur systemd services ka use karke maine ensure kiya hai ki server reboot ya failure ke case mein services apne aap restart ho jayein (24/7 Uptime).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt; Ek AI Deployment Engineer ke taur par, main hamesha manta hoon ki “Code likhna aasaan hai, par ek aisi system architecture banana jo real-world problems mein fail na ho, asli challenge wahi hai.” Yeh Smart Hospital BMS Dashboard mere liye ek bahut badi learning raha.&lt;/p&gt;

&lt;p&gt;Agar aap IoT, Edge Computing, ya Dockerized deployments mein kaam kar rahe hain, toh mujhe comments mein zaroor batayein ki aap aisi real-time data streaming problems ko kaise handle karte hain! Let’s connect and discuss.&lt;/p&gt;

&lt;h1&gt;
  
  
  IoT #SmartHospital #Docker #Python #BuildingManagementSystem #EdgeComputing #SystemArchitecture #TechForGood
&lt;/h1&gt;

</description>
      <category>docker</category>
      <category>iot</category>
      <category>python</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
