<?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: Abdullah Javed</title>
    <description>The latest articles on DEV Community by Abdullah Javed (@abdullah_javed_287f38c45e).</description>
    <link>https://dev.to/abdullah_javed_287f38c45e</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%2F4204900%2Fa2cf2770-2ef7-4a8c-84a5-23277b81a01f.JPG</url>
      <title>DEV Community: Abdullah Javed</title>
      <link>https://dev.to/abdullah_javed_287f38c45e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abdullah_javed_287f38c45e"/>
    <language>en</language>
    <item>
      <title>Sobel vs Scharr vs Laplacian: Understanding Edge Detection with OpenCV</title>
      <dc:creator>Abdullah Javed</dc:creator>
      <pubDate>Sat, 07 Nov 2026 18:49:07 +0000</pubDate>
      <link>https://dev.to/abdullah_javed_287f38c45e/sobel-vs-scharr-vs-laplacian-understanding-edge-detection-with-opencv-1l5e</link>
      <guid>https://dev.to/abdullah_javed_287f38c45e/sobel-vs-scharr-vs-laplacian-understanding-edge-detection-with-opencv-1l5e</guid>
      <description>&lt;p&gt;Edge detection is one of the fundamental techniques in Digital Image Processing. It helps identify object boundaries, shapes, and regions where image intensity changes significantly.&lt;/p&gt;

&lt;p&gt;From traditional Computer Vision applications to modern Deep Learning pipelines, edge information can play an important role in understanding visual data.&lt;/p&gt;

&lt;p&gt;But how do we detect these edges?&lt;/p&gt;

&lt;p&gt;Three commonly used operators are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sobel Operator&lt;/li&gt;
&lt;li&gt;Scharr Operator&lt;/li&gt;
&lt;li&gt;Laplacian Operator&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although all three are used for edge detection, they work differently.&lt;/p&gt;

&lt;p&gt;In this article, we'll understand their mathematical foundations, compare their characteristics, and implement them using Python and OpenCV.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What Is Edge Detection?
&lt;/h2&gt;

&lt;p&gt;An edge represents a significant change in image intensity.&lt;/p&gt;

&lt;p&gt;For example, consider a photograph of a building. The boundaries between the building and the sky, windows and walls, or roof and background create intensity transitions.&lt;/p&gt;

&lt;p&gt;Edge detection attempts to identify these transitions.&lt;/p&gt;

&lt;p&gt;Mathematically, an image can be represented as a two-dimensional intensity function:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
I(x,y)&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;(x) represents the horizontal position.&lt;/li&gt;
&lt;li&gt;(y) represents the vertical position.&lt;/li&gt;
&lt;li&gt;(I(x,y)) represents pixel intensity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Edge detection uses derivatives to measure how quickly intensity changes across an image.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Sobel Operator — First-Order Derivatives
&lt;/h2&gt;

&lt;p&gt;The Sobel operator calculates image intensity gradients in two directions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gx: Horizontal intensity gradient.&lt;/li&gt;
&lt;li&gt;Gy: Vertical intensity gradient.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It uses two 3×3 convolution kernels.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sobel X:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
G_x =&lt;br&gt;
\begin{bmatrix}&lt;br&gt;
-1 &amp;amp; 0 &amp;amp; 1\&lt;br&gt;
-2 &amp;amp; 0 &amp;amp; 2\&lt;br&gt;
-1 &amp;amp; 0 &amp;amp; 1&lt;br&gt;
\end{bmatrix}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sobel Y:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
G_y =&lt;br&gt;
\begin{bmatrix}&lt;br&gt;
-1 &amp;amp; -2 &amp;amp; -1\&lt;br&gt;
0 &amp;amp; 0 &amp;amp; 0\&lt;br&gt;
1 &amp;amp; 2 &amp;amp; 1&lt;br&gt;
\end{bmatrix}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;After calculating both gradients, we can estimate the overall gradient magnitude:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
G = \sqrt{G_x^2 + G_y^2}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;This magnitude represents the strength of intensity changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detects intensity gradients in two directions.&lt;/li&gt;
&lt;li&gt;Combines smoothing and differentiation.&lt;/li&gt;
&lt;li&gt;Computationally efficient.&lt;/li&gt;
&lt;li&gt;Commonly used for general edge detection.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  3. Scharr Operator — Improved Gradient Estimation
&lt;/h2&gt;

&lt;p&gt;The Scharr operator is another first-order derivative operator.&lt;/p&gt;

&lt;p&gt;It is designed to improve rotational symmetry and gradient estimation compared with the standard 3×3 Sobel operator.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scharr X:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
G_x =&lt;br&gt;
\begin{bmatrix}&lt;br&gt;
-3 &amp;amp; 0 &amp;amp; 3\&lt;br&gt;
-10 &amp;amp; 0 &amp;amp; 10\&lt;br&gt;
-3 &amp;amp; 0 &amp;amp; 3&lt;br&gt;
\end{bmatrix}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scharr Y:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
G_y =&lt;br&gt;
\begin{bmatrix}&lt;br&gt;
-3 &amp;amp; -10 &amp;amp; -3\&lt;br&gt;
0 &amp;amp; 0 &amp;amp; 0\&lt;br&gt;
3 &amp;amp; 10 &amp;amp; 3&lt;br&gt;
\end{bmatrix}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;The larger central weights provide a different approximation of the image gradient.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improved rotational symmetry compared with 3×3 Sobel.&lt;/li&gt;
&lt;li&gt;More accurate gradient estimation for small kernels.&lt;/li&gt;
&lt;li&gt;Useful when gradient precision matters.&lt;/li&gt;
&lt;li&gt;Still sensitive to image noise.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An important point: Scharr does not automatically eliminate noise. Preprocessing may still be necessary.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Laplacian Operator — Second-Order Derivatives
&lt;/h2&gt;

&lt;p&gt;Unlike Sobel and Scharr, the Laplacian operator uses second-order derivatives.&lt;/p&gt;

&lt;p&gt;It measures how quickly the first-order intensity gradient changes.&lt;/p&gt;

&lt;p&gt;Its mathematical expression is:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
\nabla^2 I =&lt;br&gt;
\frac{\partial^2 I}{\partial x^2}&lt;br&gt;
+&lt;br&gt;
\frac{\partial^2 I}{\partial y^2}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;A commonly used 3×3 Laplacian kernel is:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
\begin{bmatrix}&lt;br&gt;
0 &amp;amp; 1 &amp;amp; 0\&lt;br&gt;
1 &amp;amp; -4 &amp;amp; 1\&lt;br&gt;
0 &amp;amp; 1 &amp;amp; 0&lt;br&gt;
\end{bmatrix}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;Another common variant uses diagonal neighbors as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detects rapid intensity transitions.&lt;/li&gt;
&lt;li&gt;Responds to fine image details.&lt;/li&gt;
&lt;li&gt;Does not calculate separate directional gradients like Sobel and Scharr.&lt;/li&gt;
&lt;li&gt;Highly sensitive to noise.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because second-order derivatives amplify high-frequency variations, Gaussian smoothing is often applied before Laplacian edge detection.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Implementing All Three Operators with Python and OpenCV
&lt;/h2&gt;

&lt;p&gt;Now let's apply these techniques to the same image and compare their outputs.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 1: Import Libraries
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Step 2: Load and Preprocess the Image
&lt;/h3&gt;

&lt;p&gt;Edge detection is commonly performed on grayscale images.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;imread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;house.jpg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;FileNotFoundError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Image not found. Check the file path.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;gray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cvtColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;COLOR_BGR2GRAY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Reduce noise before edge detection
&lt;/span&gt;&lt;span class="n"&gt;blurred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GaussianBlur&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gray&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gaussian smoothing reduces small intensity variations that may otherwise produce unwanted edges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Apply Sobel Operator
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;sobel_x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Sobel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;blurred&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CV_64F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ksize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;sobel_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Sobel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;blurred&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CV_64F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ksize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;sobel_magnitude&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;magnitude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;sobel_x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;sobel_y&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;sobel_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;convertScaleAbs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sobel_magnitude&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;CV_64F&lt;/code&gt; preserves positive and negative derivative values.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;(1, 0)&lt;/code&gt; calculates the X derivative.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;(0, 1)&lt;/code&gt; calculates the Y derivative.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ksize=3&lt;/code&gt; specifies a 3×3 Sobel kernel.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4: Apply Scharr Operator
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;scharr_x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Scharr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;blurred&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CV_64F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;scharr_y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Scharr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;blurred&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CV_64F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;scharr_magnitude&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;magnitude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;scharr_x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;scharr_y&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;scharr_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;convertScaleAbs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scharr_magnitude&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OpenCV's &lt;code&gt;Scharr()&lt;/code&gt; function uses the standard 3×3 Scharr operator.&lt;/p&gt;

&lt;p&gt;Unlike Sobel, it does not require a kernel-size parameter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Apply Laplacian Operator
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;laplacian&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Laplacian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;blurred&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CV_64F&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ksize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;laplacian_output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;convertScaleAbs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;laplacian&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Laplacian calculates second-order intensity changes.&lt;/p&gt;

&lt;p&gt;Notice that we use &lt;code&gt;CV_64F&lt;/code&gt; here as well to preserve negative and positive derivative responses before converting the result for visualization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Visualize the Results
&lt;/h3&gt;

&lt;p&gt;Let's display all four images together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;images&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="n"&gt;gray&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;sobel_output&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;scharr_output&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;laplacian_output&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;titles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Original Grayscale&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Sobel&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Scharr&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Laplacian&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;figsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;imshow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;images&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;cmap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gray&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;titles&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;axis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;off&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tight_layout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What should you observe?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sobel highlights intensity gradients.&lt;/li&gt;
&lt;li&gt;Scharr provides a different gradient approximation with improved rotational symmetry.&lt;/li&gt;
&lt;li&gt;Laplacian highlights second-order intensity transitions and may produce more noise-related responses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The exact appearance depends on the image, preprocessing, and visualization scaling.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Sobel vs Scharr vs Laplacian
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Sobel&lt;/th&gt;
&lt;th&gt;Scharr&lt;/th&gt;
&lt;th&gt;Laplacian&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Derivative&lt;/td&gt;
&lt;td&gt;First-order&lt;/td&gt;
&lt;td&gt;First-order&lt;/td&gt;
&lt;td&gt;Second-order&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Direction&lt;/td&gt;
&lt;td&gt;X and Y&lt;/td&gt;
&lt;td&gt;X and Y&lt;/td&gt;
&lt;td&gt;Combined&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Main purpose&lt;/td&gt;
&lt;td&gt;Gradient detection&lt;/td&gt;
&lt;td&gt;Improved gradient estimation&lt;/td&gt;
&lt;td&gt;Intensity transition detection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Noise sensitivity&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Main advantage&lt;/td&gt;
&lt;td&gt;Simple and efficient&lt;/td&gt;
&lt;td&gt;Improved rotational symmetry&lt;/td&gt;
&lt;td&gt;Fine intensity transitions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Common use&lt;/td&gt;
&lt;td&gt;General edge detection&lt;/td&gt;
&lt;td&gt;More precise gradients&lt;/td&gt;
&lt;td&gt;Edge and detail analysis&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Noise sensitivity is qualitative and depends on preprocessing and image characteristics.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Real-World Applications
&lt;/h2&gt;

&lt;p&gt;These operators are useful in different Computer Vision workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Object Detection:&lt;/strong&gt; Edge information can help identify object boundaries and shapes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Image Segmentation:&lt;/strong&gt; Gradient information can support the separation of regions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Medical Imaging:&lt;/strong&gt; Edge information can help highlight anatomical structures and boundaries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Autonomous Systems:&lt;/strong&gt; Visual boundaries and structural information can support perception pipelines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature Extraction:&lt;/strong&gt; Gradients can provide useful information for traditional feature descriptors such as HOG.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9lajyy1qzyqmzyj6brhy.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9lajyy1qzyqmzyj6brhy.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Sobel, Scharr, and Laplacian all help analyze image intensity changes, but they are not interchangeable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sobel:&lt;/strong&gt; A practical choice for general gradient detection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scharr:&lt;/strong&gt; Useful when improved gradient estimation with a 3×3 kernel is important.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Laplacian:&lt;/strong&gt; Useful for analyzing second-order intensity transitions, but requires attention to noise.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important lesson is that choosing an edge detection operator is not just about finding more edges... it is about extracting the right information for the task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My next step:&lt;/strong&gt; Experiment with these operators on different images, compare their outputs, and observe how Gaussian smoothing changes the results.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What's your experience with edge detection? Have you used Sobel, Scharr, or Laplacian in your Computer Vision projects?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear your thoughts!&lt;/p&gt;

&lt;h1&gt;
  
  
  ComputerVision #OpenCV #Python #ImageProcessing #EdgeDetection #MachineLearning #ArtificialIntelligence #ResearchNotes
&lt;/h1&gt;

</description>
      <category>code</category>
      <category>computerscience</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Image Quantization Explained: Uniform, Non-Uniform and Vector Quantization</title>
      <dc:creator>Abdullah Javed</dc:creator>
      <pubDate>Thu, 05 Nov 2026 17:43:57 +0000</pubDate>
      <link>https://dev.to/abdullah_javed_287f38c45e/image-quantization-explained-uniform-non-uniform-and-vector-quantization-21k6</link>
      <guid>https://dev.to/abdullah_javed_287f38c45e/image-quantization-explained-uniform-non-uniform-and-vector-quantization-21k6</guid>
      <description>&lt;h1&gt;
  
  
  Image Quantization Explained: Uniform, Non-Uniform and Vector Quantization
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;How do we reduce image representation complexity while preserving important visual information?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Image quantization is a fundamental concept in Digital Image Processing and Computer Vision.&lt;/p&gt;

&lt;p&gt;Digital images contain numerical pixel values. However, storing or processing every value at its original precision is not always necessary.&lt;/p&gt;

&lt;p&gt;Quantization addresses this by mapping pixel values to a limited number of discrete levels.&lt;/p&gt;

&lt;p&gt;Let's understand the mathematics, different approaches, and practical implementation using Python and OpenCV.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What Is Image Quantization?
&lt;/h2&gt;

&lt;p&gt;Image quantization reduces the number of distinct intensity or color values used to represent an image.&lt;/p&gt;

&lt;p&gt;For a channel represented using (b) bits, the maximum number of possible levels is:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
K = 2^b&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bit depth&lt;/th&gt;
&lt;th&gt;Quantization levels&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1-bit&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2-bit&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4-bit&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8-bit&lt;/td&gt;
&lt;td&gt;256&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Reducing the number of levels introduces quantization error because the original pixel values are approximated.&lt;/p&gt;

&lt;p&gt;This is generally a lossy operation.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Uniform Quantization
&lt;/h2&gt;

&lt;p&gt;Uniform quantization divides the available intensity range into equally spaced intervals.&lt;/p&gt;

&lt;p&gt;For an 8-bit grayscale image, the intensity range is 0–255.&lt;/p&gt;

&lt;p&gt;If we use 16 quantization levels, the range is represented using fewer possible output values.&lt;/p&gt;

&lt;p&gt;A simplified quantization step size is:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
\Delta = \frac{255}{K-1}&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;The quantized value can be calculated as:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
Q(x)=\Delta \cdot round\left(\frac{x}{\Delta}\right)&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple implementation.&lt;/li&gt;
&lt;li&gt;Low computational complexity.&lt;/li&gt;
&lt;li&gt;Predictable quantization intervals.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Limitation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;May introduce visible banding and loss of fine details.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  3. Non-Uniform Quantization
&lt;/h2&gt;

&lt;p&gt;Unlike uniform quantization, non-uniform quantization uses intervals of different widths.&lt;/p&gt;

&lt;p&gt;More quantization levels can be allocated to regions where precision is more important.&lt;/p&gt;

&lt;p&gt;For example, an image-processing system may use finer quantization in darker intensity regions and coarser quantization elsewhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flexible precision allocation.&lt;/li&gt;
&lt;li&gt;Can reduce reconstruction error for a given number of levels.&lt;/li&gt;
&lt;li&gt;Useful in perceptual signal processing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The actual benefit depends on the image statistics and the chosen distortion measure.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Vector Quantization (VQ)
&lt;/h2&gt;

&lt;p&gt;Vector quantization operates on groups of values instead of treating every pixel independently.&lt;/p&gt;

&lt;p&gt;It uses a codebook containing representative vectors.&lt;/p&gt;

&lt;p&gt;The input vector is mapped to the closest codebook entry according to a selected distance metric.&lt;/p&gt;

&lt;p&gt;A simplified representation is:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
Q(x)=\arg\min_{c_i \in C} d(x,c_i)&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;(x) is the input vector.&lt;/li&gt;
&lt;li&gt;(C) is the codebook.&lt;/li&gt;
&lt;li&gt;(c_i) represents a codebook vector.&lt;/li&gt;
&lt;li&gt;(d) measures the distance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vector quantization is used in compression and has connections to codebook-based representation learning.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Practical Implementation Using Python and OpenCV
&lt;/h2&gt;

&lt;p&gt;Let's implement uniform quantization for a grayscale image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;

&lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;imread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;image.jpg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IMREAD_GRAYSCALE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;quantize_image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;levels&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;levels&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;quantized&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;quantized&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;astype&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uint8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;q_2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;quantize_image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;q_4&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;quantize_image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;q_16&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;quantize_image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;q_256&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;quantize_image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;images&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q_2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q_4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q_16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q_256&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;titles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Original&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2 Levels&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;4 Levels&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;16 Levels&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;256 Levels&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;figure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;figsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;images&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;titles&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
    &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;imshow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cmap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gray&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vmin&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vmax&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;axis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;off&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tight_layout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Observe how reducing the number of levels changes the visual representation.&lt;/p&gt;

&lt;p&gt;With fewer levels, intensity transitions become more noticeable and fine details may disappear.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Image Quantization vs Model Quantization
&lt;/h2&gt;

&lt;p&gt;These terms are related but describe different operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Image Quantization&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Operates on image pixel values.&lt;/li&gt;
&lt;li&gt;Reduces the number of available intensity or color values.&lt;/li&gt;
&lt;li&gt;Can be used in image representation and compression pipelines.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Model Quantization&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Operates on neural network weights and activations.&lt;/li&gt;
&lt;li&gt;Converts higher-precision numerical representations into lower-precision formats.&lt;/li&gt;
&lt;li&gt;Can reduce model memory requirements and improve inference efficiency on supported hardware.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both techniques can improve efficiency, but they should not be confused.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Why Does Quantization Matter in Computer Vision?
&lt;/h2&gt;

&lt;p&gt;Quantization is relevant to several applications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Image compression.&lt;/li&gt;
&lt;li&gt;Low-bandwidth image transmission.&lt;/li&gt;
&lt;li&gt;Memory-constrained vision systems.&lt;/li&gt;
&lt;li&gt;Embedded and edge computing.&lt;/li&gt;
&lt;li&gt;Efficient neural network deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One important distinction: reducing the number of distinct pixel values does not automatically reduce the image file size. Storage savings depend on how the quantized values are encoded and compressed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaway
&lt;/h2&gt;

&lt;p&gt;Image quantization is not simply about reducing pixel precision.&lt;/p&gt;

&lt;p&gt;It is about finding an appropriate balance between representation efficiency and information preservation.&lt;/p&gt;

&lt;p&gt;The right quantization strategy depends on the image characteristics, application requirements, and acceptable reconstruction error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Discussion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When designing a Computer Visi&lt;br&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcg2068uqdewxcfldva5m.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcg2068uqdewxcfldva5m.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further Learning&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Digital Image Processing — Rafael C. Gonzalez and Richard E. Woods.&lt;/li&gt;
&lt;li&gt;OpenCV Documentation: &lt;a href="https://docs.opencv.org/" rel="noopener noreferrer"&gt;https://docs.opencv.org/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Quantization and vector quantization concepts in digital signal processing.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>computerscience</category>
      <category>computervision</category>
    </item>
    <item>
      <title>Integrating YOLO Fire Detection with FastAPI and Next.js 🔥</title>
      <dc:creator>Abdullah Javed</dc:creator>
      <pubDate>Tue, 27 Oct 2026 11:42:55 +0000</pubDate>
      <link>https://dev.to/abdullah_javed_287f38c45e/integrating-yolo-fire-detection-with-fastapi-and-nextjs-19k1</link>
      <guid>https://dev.to/abdullah_javed_287f38c45e/integrating-yolo-fire-detection-with-fastapi-and-nextjs-19k1</guid>
      <description>&lt;p&gt;A practical walkthrough of setting up FlameGuard, connecting a custom YOLO model, and debugging a full-stack Computer Vision application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I recently explored &lt;strong&gt;FlameGuard&lt;/strong&gt;, an open-source fire detection application built with YOLO, FastAPI, and Next.js.&lt;/p&gt;

&lt;p&gt;I wanted to understand how a trained object detection model works inside a complete web application.&lt;/p&gt;

&lt;p&gt;I used the &lt;a href="https://github.com/nohsangwoo/FlameGuard" rel="noopener noreferrer"&gt;original FlameGuard repository&lt;/a&gt; and adapted it to work with my own trained fire detection model.&lt;/p&gt;

&lt;p&gt;Here's a breakdown of the implementation and what I learned.&lt;/p&gt;

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

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Backend development&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;YOLO&lt;/td&gt;
&lt;td&gt;Fire detection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenCV&lt;/td&gt;
&lt;td&gt;Image processing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FastAPI&lt;/td&gt;
&lt;td&gt;REST API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQLite&lt;/td&gt;
&lt;td&gt;Detection history&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Next.js&lt;/td&gt;
&lt;td&gt;Frontend&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;React&lt;/td&gt;
&lt;td&gt;User interface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Conda&lt;/td&gt;
&lt;td&gt;Dependency management&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  1. Project Setup
&lt;/h2&gt;

&lt;p&gt;Clone the repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/nohsangwoo/FlameGuard.git
&lt;span class="nb"&gt;cd &lt;/span&gt;FlameGuard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main project structure is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FlameGuard/
├── backend/
│   ├── app/
│   └── environment.yml
├── frontend/
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create the Python environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;backend
conda &lt;span class="nb"&gt;env &lt;/span&gt;create &lt;span class="nt"&gt;-f&lt;/span&gt; environment.yml
conda activate flameguard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Integrating the YOLO Model
&lt;/h2&gt;

&lt;p&gt;I already had a trained fire detection model named &lt;code&gt;best.pt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The model contains one detection class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fire&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I placed the model in the backend's assets directory and configured the detection endpoint to use it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;ultralytics&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;YOLO&lt;/span&gt;

&lt;span class="n"&gt;APP_DIR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;parents&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;MODEL_PATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;APP_DIR&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;assets&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;best.pt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;YOLO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MODEL_PATH&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Loading the model outside the API handler avoids repeatedly initializing it for each request.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Running Fire Detection
&lt;/h2&gt;

&lt;p&gt;The prediction process uses the YOLO model to analyze an uploaded image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;predict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;temp_file_path&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;imgsz&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;640&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can extract detection information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;box&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;boxes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;class_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;class_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;class_id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;confidence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;bbox&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xyxy&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;tolist&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;class_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;confidence&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bbox&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each detection includes a predicted class, confidence score, and bounding-box coordinates.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Creating Annotated Images
&lt;/h2&gt;

&lt;p&gt;Ultralytics provides a convenient method for drawing predicted bounding boxes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;annotated_img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The annotated image can then be saved using OpenCV:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cv2&lt;/span&gt;

&lt;span class="n"&gt;cv2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;imwrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;log_file_path&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;annotated_img&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These images can be used by the frontend to display detection results.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. FastAPI Integration
&lt;/h2&gt;

&lt;p&gt;The backend exposes a prediction endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /predict_fire
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It receives an uploaded image, processes it with YOLO, and returns a structured detection response.&lt;/p&gt;

&lt;p&gt;For example, one of my tests returned:&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;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"fire detected"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"file_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;"frame.jpg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"detections"&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;span class="nl"&gt;"class_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;"fire"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"confidence"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.419&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;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;The API can also store detection information in SQLite for later retrieval.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Debugging Detection Images
&lt;/h2&gt;

&lt;p&gt;One issue I encountered was that the backend returned successful predictions, but detection images were missing.&lt;/p&gt;

&lt;p&gt;The logs showed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /predict_fire 200 OK
GET /log/image.jpg 404 Not Found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I investigated the image-saving and static-file directory paths.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;pathlib&lt;/code&gt; helped keep the paths consistent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;

&lt;span class="n"&gt;APP_DIR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;parents&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;LOG_DIR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;APP_DIR&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;log&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;LOG_DIR&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mkdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parents&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;exist_ok&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was a useful lesson in handling generated files inside FastAPI applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Running the Backend
&lt;/h2&gt;

&lt;p&gt;From the backend directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; uvicorn app.main:app &lt;span class="nt"&gt;--reload&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The backend runs at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;API documentation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:8000/docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8. Running the Next.js Frontend
&lt;/h2&gt;

&lt;p&gt;Open another terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;frontend
pnpm &lt;span class="nb"&gt;install
&lt;/span&gt;pnpm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The frontend runs at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The interface communicates with the FastAPI backend to process images and retrieve detection results.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Handling Camera Errors
&lt;/h2&gt;

&lt;p&gt;During testing, I encountered a browser error related to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mediaDevices&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;enumerateDevices&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A simple feature check helps prevent the application from crashing when the browser camera API is unavailable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mediaDevices&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;enumerateDevices&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Camera API unavailable&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;devices&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mediaDevices&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;enumerateDevices&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Browser permissions and secure-context requirements are important when working with camera-based applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Lessons Learned
&lt;/h2&gt;

&lt;p&gt;This project helped me better understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;YOLO inference and detection results.&lt;/li&gt;
&lt;li&gt;FastAPI integration with Computer Vision models.&lt;/li&gt;
&lt;li&gt;Image annotation and file management.&lt;/li&gt;
&lt;li&gt;SQLite detection logging.&lt;/li&gt;
&lt;li&gt;Next.js and backend communication.&lt;/li&gt;
&lt;li&gt;Debugging missing images and browser camera errors.&lt;/li&gt;
&lt;li&gt;Organizing a full-stack AI application.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Future Improvements
&lt;/h2&gt;

&lt;p&gt;I plan to explore better detection accuracy, improve frontend interactions, test more challenging images, and make the application more reliable for continuous monitoring.&lt;/p&gt;

&lt;p&gt;The current project is a learning experiment rather than a production-ready fire safety system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Working on FlameGuard was a valuable opportunity to connect Computer Vision concepts with full-stack application development.&lt;/p&gt;

&lt;p&gt;It also reminded me that a trained AI model is only one part of a complete application.&lt;/p&gt;

&lt;p&gt;There is much more to explore, and I look forward to improving my understanding through more practical projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Original project:&lt;/strong&gt; &lt;a href="https://github.com/nohsangwoo/FlameGuard" rel="noopener noreferrer"&gt;FlameGuard by nohsangwoo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/abdullahjave" rel="noopener noreferrer"&gt;github.com/abdullahjave&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>python</category>
      <category>computervision</category>
      <category>ai</category>
      <category>powerapps</category>
    </item>
    <item>
      <title>Connecting AI Agents to Scientific Tools with MCP: My OSI Hackathon 2026</title>
      <dc:creator>Abdullah Javed</dc:creator>
      <pubDate>Sat, 24 Oct 2026 19:19:55 +0000</pubDate>
      <link>https://dev.to/abdullah_javed_287f38c45e/connecting-ai-agents-to-scientific-tools-with-mcp-my-osi-hackathon-2026-5g3</link>
      <guid>https://dev.to/abdullah_javed_287f38c45e/connecting-ai-agents-to-scientific-tools-with-mcp-my-osi-hackathon-2026-5g3</guid>
      <description>&lt;h1&gt;
  
  
  Connecting AI Agents to Scientific Tools with MCP: My OSI Hackathon 2026 Experience
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Building reproducible AI-agent workflows with Python, Claude Code, GitHub Copilot CLI, and scientific MCP tools.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;What happens when we connect AI coding agents to real scientific tools?&lt;/p&gt;

&lt;p&gt;That was one of the questions I explored while contributing to &lt;strong&gt;KnowledgeIsPower&lt;/strong&gt;, an open-source project developed during the &lt;strong&gt;OSI Hackathon 2026 (October 21–22)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Our team, led by Amit Shenoy, worked on a problem in &lt;strong&gt;single-cell proteomics&lt;/strong&gt;: estimating missing protein measurements using biological knowledge and data-driven methods.&lt;/p&gt;

&lt;p&gt;We developed &lt;code&gt;scp-graphfs-mcp&lt;/code&gt;, a scientific Model Context Protocol (MCP) server that enables AI agents to interact with protein-complex data, knowledge graphs, and imputation tools.&lt;/p&gt;

&lt;p&gt;My contribution focused on &lt;strong&gt;S5: MCP Client Integration, Testing, and Documentation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this article, I'll walk through the project architecture, how I connected AI agents to the MCP server, and what I learned from running a real scientific workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Problem We Were Solving
&lt;/h2&gt;

&lt;p&gt;Single-cell proteomics helps researchers measure proteins in individual cells.&lt;/p&gt;

&lt;p&gt;However, mass-spectrometry experiments often produce incomplete measurements. Depending on the experiment, only around 20–60% of a cell's proteins may be quantified.&lt;/p&gt;

&lt;p&gt;Researchers use &lt;strong&gt;imputation&lt;/strong&gt; to estimate missing values.&lt;/p&gt;

&lt;p&gt;Traditional approaches, including k-nearest neighbors (kNN), rely on patterns already present in the dataset.&lt;/p&gt;

&lt;p&gt;Our team explored whether biological knowledge, particularly relationships between proteins, could improve these estimates.&lt;/p&gt;

&lt;p&gt;The project ultimately compared &lt;strong&gt;22 protein knowledge representations&lt;/strong&gt; and investigated methods for transferring protein co-regulation information from external datasets.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. What Is MCP?
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt; provides a standardized way for AI applications to connect with external tools and data sources.&lt;/p&gt;

&lt;p&gt;An MCP server exposes tools, while an MCP-compatible client allows an AI agent to discover and call them.&lt;/p&gt;

&lt;p&gt;For our project, the architecture looked 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;             AI Agent / MCP Client
                       |
           +-----------+-----------+
           |                       |
      Claude Code            GitHub Copilot CLI
           |                       |
           +-----------+-----------+
                       |
                MCP Protocol
                 (STDIO)
                       |
               scp-graphfs-mcp
                       |
             Scientific MCP Tools
                       |
       Protein Complexes / Knowledge Graphs
                       |
           Proteomics Dataset Analysis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of writing a separate integration for every AI client, we could expose scientific capabilities through one MCP server.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Six Scientific MCP Tools
&lt;/h2&gt;

&lt;p&gt;Our server exposed six tools:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;MCP Tool&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_complexes&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Retrieve protein-complex information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;explain_protein&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Explore biological information about a protein&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;build_prior&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Construct knowledge-based priors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;propagate_scores&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Propagate information through graph relationships&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;impute_with_prior&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Impute missing values using a biological prior&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;select_panel&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Support protein measurement-panel selection&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These tools made it possible to move from a natural-language research question to structured scientific operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Setting Up the Development Environment
&lt;/h2&gt;

&lt;p&gt;I worked with the project's Python environment and MCP server.&lt;/p&gt;

&lt;p&gt;After cloning the repository, I created a virtual environment and installed the development dependencies.&lt;/p&gt;

&lt;p&gt;On Windows PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;clone&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;https://github.com/xX-its-amit-Xx/knowledgeispower.git&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;knowledgeispower&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;switch&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;claude/happy-hamilton-kdexid&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-m&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;venv&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;venv&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;\.venv\Scripts\Activate.ps1&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-m&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;pip&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-e&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;".[dev]"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repository's active development branch was important because it contained the implementation used for the hackathon.&lt;/p&gt;

&lt;p&gt;I also ran the project's offline tests and checked that the MCP server exposed its expected tools.&lt;/p&gt;

&lt;p&gt;During my local testing, the offline suite reported:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;19 passed, 27 xfailed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was a snapshot of my development environment, not the final project's complete test count.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Connecting Claude Code to the MCP Server
&lt;/h2&gt;

&lt;p&gt;One of my tasks was configuring Claude Code as an MCP client.&lt;/p&gt;

&lt;p&gt;I installed the Claude Code CLI and registered the local scientific server using STDIO transport.&lt;/p&gt;

&lt;p&gt;The following example uses a Windows virtual environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;claude&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mcp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--transport&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;stdio&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;scp-graphfs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;".\.venv\Scripts\scp-graphfs-mcp.exe"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a local installation, use the actual executable path from your environment. An absolute path is generally more reliable.&lt;/p&gt;

&lt;p&gt;To inspect the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;claude&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mcp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;claude&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mcp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;get&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;scp-graphfs&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I successfully configured the connection and verified that Claude Code recognized the MCP server.&lt;/p&gt;

&lt;p&gt;However, I couldn't complete a full Claude Code AI session myself because I didn't have the required Claude access.&lt;/p&gt;

&lt;p&gt;The connection setup and verification were completed; a real Claude Code session transcript was not part of my individual submission.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Connecting GitHub Copilot CLI
&lt;/h2&gt;

&lt;p&gt;I also configured &lt;strong&gt;GitHub Copilot CLI&lt;/strong&gt; to communicate with &lt;code&gt;scp-graphfs-mcp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After installing and authenticating Copilot CLI, I used its MCP configuration interface to register the server.&lt;/p&gt;

&lt;p&gt;The configuration included:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Server name: scp-graphfs
Transport: STDIO
Command: &amp;lt;absolute-path-to-scp-graphfs-mcp.exe&amp;gt;
Environment variables: None required
Tools: *
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After configuration, the MCP server reported a connected status.&lt;/p&gt;

&lt;p&gt;All six scientific tools were available to the Copilot agent.&lt;/p&gt;

&lt;p&gt;This allowed me to run a real scientific analysis through an AI-agent workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Running a Real Scientific Experiment
&lt;/h2&gt;

&lt;p&gt;I used GitHub Copilot CLI to investigate the &lt;strong&gt;26S proteasome&lt;/strong&gt;, a protein complex involved in protein degradation.&lt;/p&gt;

&lt;p&gt;The research question was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which subunits of the 26S proteasome are measured in &lt;code&gt;data/datasets/petrosius2023_aml_sc.h5ad&lt;/code&gt;, and how many of their missing values can be filled from partners?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The workflow involved retrieving the protein complex, examining the dataset, preparing a 26S-only subset, and using the MCP imputation tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Retrieve the Protein Complex
&lt;/h3&gt;

&lt;p&gt;The agent called the MCP tool with parameters equivalent to:&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;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PSMB5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sources"&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="s2"&gt;"complexportal"&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;The tool identified:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Complex Portal ID: CPX-5993
Complex: 26S proteasome
Total subunits: 33
Measured subunits: 31
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two subunits, &lt;code&gt;PSMB3&lt;/code&gt; and &lt;code&gt;SEM1&lt;/code&gt;, were not measured in the dataset.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Prepare the Dataset
&lt;/h3&gt;

&lt;p&gt;The experiment used the Petrosius 2023 single-cell proteomics dataset.&lt;/p&gt;

&lt;p&gt;The agent-assisted workflow prepared a temporary &lt;code&gt;.h5ad&lt;/code&gt; subset containing the measured 26S proteasome proteins.&lt;/p&gt;

&lt;p&gt;This subset was important because the following imputation counts applied specifically to the 26S proteasome experiment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Impute Missing Measurements
&lt;/h3&gt;

&lt;p&gt;The agent called &lt;code&gt;impute_with_prior&lt;/code&gt; using the Complex Portal biological prior.&lt;/p&gt;

&lt;p&gt;The resulting metrics were:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Total missing values&lt;/td&gt;
&lt;td&gt;638&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Imputed from protein partners&lt;/td&gt;
&lt;td&gt;607&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kNN fallback imputations&lt;/td&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Partner-based coverage&lt;/td&gt;
&lt;td&gt;95.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The experiment showed that the MCP tool could use protein-complex relationships to fill many missing entries in this particular subset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; The 95.1% figure describes the fraction of missing entries handled through partner-based imputation. It is not an accuracy score or evidence that this method outperformed kNN.&lt;/p&gt;

&lt;p&gt;The complete real-session transcript was preserved in the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. What Did the Team's Research Show?
&lt;/h2&gt;

&lt;p&gt;Alongside MCP integration, the team conducted a broader scientific benchmark.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finding 1: Curated Biological Knowledge Was Useful but Insufficient
&lt;/h3&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fodc8bgbj348uku1j0lff.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fodc8bgbj348uku1j0lff.png" alt="Comparison of 22 biological knowledge representations" width="665" height="662"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 1. Comparison of 22 biological knowledge representations. Curated physical complexes ranked highest among the priors, but none independently beat the plain kNN baseline. Source: KnowledgeIsPower team, OSI Hackathon 2026.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The top curated knowledge sources included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complex Portal&lt;/li&gt;
&lt;li&gt;PDB co-structure&lt;/li&gt;
&lt;li&gt;CORUM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These represented meaningful biological relationships, but none of the individual priors passed the project's development gate against the strongest data-only methods.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finding 2: Reference-Based Protein Imputation Improved the Final Holdout Results
&lt;/h3&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuxrh4anxe364rtzxddid.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuxrh4anxe364rtzxddid.png" alt="Untouched Brunner 2022 holdout results comparing the reference-based method with data-only baselines" width="799" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 2. Untouched Brunner 2022 holdout experiment. The reference-based method reduced in-complex RMSE compared with the strongest data-only baseline. Source: KnowledgeIsPower team, OSI Hackathon 2026.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The final reported comparison showed:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Baseline&lt;/th&gt;
&lt;th&gt;MCAR improvement&lt;/th&gt;
&lt;th&gt;MNAR improvement&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;kNN&lt;/td&gt;
&lt;td&gt;6.0%&lt;/td&gt;
&lt;td&gt;8.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kNN + low-rank&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2.4%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;5.4%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scrambled reference&lt;/td&gt;
&lt;td&gt;2.5%&lt;/td&gt;
&lt;td&gt;4.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All six reported paired-bootstrap 95% confidence intervals were below zero.&lt;/p&gt;

&lt;p&gt;However, an earlier holdout produced weaker results against the strongest data-only baseline, so replication remained an important limitation.&lt;/p&gt;

&lt;p&gt;The key research lesson was that &lt;strong&gt;learning protein relationships from external biological data could be more effective than relying on curated protein-complex knowledge alone&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. My Open-Source Contribution
&lt;/h2&gt;

&lt;p&gt;My work focused on practical MCP integration and reproducible documentation.&lt;/p&gt;

&lt;p&gt;I completed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code CLI installation, MCP registration, and connection verification.&lt;/li&gt;
&lt;li&gt;GitHub Copilot CLI authentication and MCP integration.&lt;/li&gt;
&lt;li&gt;Verification of all six scientific MCP tools.&lt;/li&gt;
&lt;li&gt;A real agent-assisted proteomics experiment.&lt;/li&gt;
&lt;li&gt;Local development setup and offline testing.&lt;/li&gt;
&lt;li&gt;A reproducible GitHub Copilot CLI setup guide.&lt;/li&gt;
&lt;li&gt;Export and redaction of the real agent-session transcript.&lt;/li&gt;
&lt;li&gt;Submission of the documentation through &lt;strong&gt;merged Pull Request #8&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My merged contribution is available here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/xX-its-amit-Xx/knowledgeispower/pull/8" rel="noopener noreferrer"&gt;https://github.com/xX-its-amit-Xx/knowledgeispower/pull/8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The scientific benchmark results discussed above were produced by the broader KnowledgeIsPower team.&lt;/p&gt;

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

&lt;p&gt;This project gave me hands-on experience with several technologies and practices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MCP integration:&lt;/strong&gt; How AI agents can communicate with specialized tools using a standard protocol.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI-assisted scientific workflows:&lt;/strong&gt; How an agent can combine natural-language questions with structured scientific operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python and bioinformatics:&lt;/strong&gt; Working with proteomics datasets, protein identifiers, and scientific tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Testing and reproducibility:&lt;/strong&gt; Why setup instructions, tool outputs, and real session transcripts matter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open-source collaboration:&lt;/strong&gt; Contributing to an existing repository, following project specifications, and submitting pull requests.&lt;/p&gt;

&lt;p&gt;Coming from a computer vision and machine learning background, I found it especially interesting to see how AI agents could support research outside my usual domain.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Final Thoughts
&lt;/h2&gt;

&lt;p&gt;The OSI Hackathon 2026 was an opportunity to explore the intersection of &lt;strong&gt;AI agents, scientific computing, biological knowledge, and open-source software&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Our team built a functional MCP-based research system and reported both positive findings and important limitations.&lt;/p&gt;

&lt;p&gt;My contribution helped demonstrate how an external AI coding agent could connect to the scientific server and execute a reproducible analysis.&lt;/p&gt;

&lt;p&gt;I'm grateful to our team lead &lt;strong&gt;Amit Shenoy&lt;/strong&gt; and my teammates &lt;strong&gt;Ratish Panda, Eeshan Khan, Fatima Zahra, and Asiya Ali&lt;/strong&gt; for the collaboration.&lt;/p&gt;

&lt;p&gt;I look forward to working on more projects involving AI agents, MCP, computer vision, and scientific research.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Links
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Official OSI Hackathon 2026:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://scientificintelligence.org/campaigns/osi-hackathon-2026" rel="noopener noreferrer"&gt;https://scientificintelligence.org/campaigns/osi-hackathon-2026&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;KnowledgeIsPower Submission:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://scientificintelligence.org/campaigns/osi-hackathon-2026/submissions/190" rel="noopener noreferrer"&gt;https://scientificintelligence.org/campaigns/osi-hackathon-2026/submissions/190&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project Repository:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/xX-its-amit-Xx/knowledgeispower" rel="noopener noreferrer"&gt;https://github.com/xX-its-amit-Xx/knowledgeispower&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Merged Pull Request:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/xX-its-amit-Xx/knowledgeispower/pull/8" rel="noopener noreferrer"&gt;https://github.com/xX-its-amit-Xx/knowledgeispower/pull/8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My GitHub:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/abdullahjave" rel="noopener noreferrer"&gt;https://github.com/abdullahjave&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by Abdullah Javed — Computer Science student, AI and Computer Vision enthusiast, and open-source contributor.&lt;/em&gt;&lt;/p&gt;

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