<?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: Ahmad Anas</title>
    <description>The latest articles on DEV Community by Ahmad Anas (@ahmad_anas_0edb1a3236362e).</description>
    <link>https://dev.to/ahmad_anas_0edb1a3236362e</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4239897%2Fa2532422-3b2e-4f14-9bbd-dad239434855.png</url>
      <title>DEV Community: Ahmad Anas</title>
      <link>https://dev.to/ahmad_anas_0edb1a3236362e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ahmad_anas_0edb1a3236362e"/>
    <language>en</language>
    <item>
      <title>I built a shoplifting detector that runs on 8GB RAM and speaks Arabic. Here's how.</title>
      <dc:creator>Ahmad Anas</dc:creator>
      <pubDate>Wed, 11 Nov 2026 21:53:14 +0000</pubDate>
      <link>https://dev.to/ahmad_anas_0edb1a3236362e/how-i-built-an-arabic-first-shoplifting-detector-with-yolov8-and-qwen2-vl-on-8gb-ram-1i40</link>
      <guid>https://dev.to/ahmad_anas_0edb1a3236362e/how-i-built-an-arabic-first-shoplifting-detector-with-yolov8-and-qwen2-vl-on-8gb-ram-1i40</guid>
      <description>&lt;h1&gt;
  
  
  How I Built an Arabic-First Shoplifting Detector with YOLOv8 and Qwen2-VL (on 8GB RAM)
&lt;/h1&gt;

&lt;p&gt;Retail theft costs small stores 2-3% of annual revenue. Existing AI solutions (Everseen, Veesion) cost $50-200/month and don't support Arabic. I wanted to build something that runs on a single 8GB computer and works in Arabic from day one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Technical Challenge: Running Qwen on a Potato
&lt;/h2&gt;

&lt;p&gt;The hardest part was AI verification. I wanted to use Qwen2-VL-2B to reduce false positives, but running a 2-billion parameter model on 8GB RAM with no GPU is not trivial. Here's how I did it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Quantization is non-negotiable:&lt;/strong&gt; I used the Q4_K_M GGUF version (~1.1 GB instead of ~4.4 GB).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;llama.cpp&lt;/code&gt; directly, not Ollama:&lt;/strong&gt; Ollama had issues with image inputs for this model. &lt;code&gt;llama-mtmd-cli&lt;/code&gt; worked perfectly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The magic flag:&lt;/strong&gt; &lt;code&gt;--image-min-tokens 1024&lt;/code&gt;. Without it, the model would produce repetitive garbage. With it, it gives coherent answers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timeout management:&lt;/strong&gt; It takes ~45 seconds per check on CPU. This is acceptable because it only runs on suspicious events, not every frame.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Architecture (Simplified)
&lt;/h2&gt;

&lt;p&gt;The system uses YOLOv8 for detection, DeepSORT for tracking, and behavior rules for loitering/concealment. It converts pixel coordinates to GPS, sends Telegram alerts, and saves 6-second H.264 video clips as evidence.&lt;/p&gt;

&lt;p&gt;The system also uses CLIP for recurring visitor detection and saves 6-second H.264 clips as evidence.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start with the smallest model that works.&lt;/strong&gt; I started with YOLOv8n (nano), not the largest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quantize early.&lt;/strong&gt; Don't wait until you run out of RAM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The "boring" parts matter.&lt;/strong&gt; GPS mapping and alert formatting took as much time as the AI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Arabic support is a superpower.&lt;/strong&gt; Most global products ignore it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;The whole thing is MIT licensed. You can clone it, run it on your laptop, and test it with your own videos.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/youssoufahmad655-wq/Guardian-Eye" rel="noopener noreferrer"&gt;https://github.com/youssoufahmad655-wq/Guardian-Eye&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any feedback on reducing false positives is welcome.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What do you think? Would you use this in your store? Let me know in the comments below!&lt;/strong&gt; 👇&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>python</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
