<?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: rohit manglani</title>
    <description>The latest articles on DEV Community by rohit manglani (@rohitm007).</description>
    <link>https://dev.to/rohitm007</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%2F1814399%2F20c6d4f7-ed6b-417c-82c7-6265a4d5fdc6.png</url>
      <title>DEV Community: rohit manglani</title>
      <link>https://dev.to/rohitm007</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rohitm007"/>
    <language>en</language>
    <item>
      <title>I built face recognition and a duplicate photo finder that run entirely in the browser</title>
      <dc:creator>rohit manglani</dc:creator>
      <pubDate>Tue, 17 Nov 2026 03:16:49 +0000</pubDate>
      <link>https://dev.to/rohitm007/i-built-face-recognition-and-a-duplicate-photo-finder-that-run-entirely-in-the-browser-f76</link>
      <guid>https://dev.to/rohitm007/i-built-face-recognition-and-a-duplicate-photo-finder-that-run-entirely-in-the-browser-f76</guid>
      <description>&lt;p&gt;My photo folder had the usual problems: years of copies named &lt;code&gt;IMG_0412 (1).jpg&lt;/code&gt;, and no way to find every picture of one person without uploading everything to a cloud service.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://photos.fullstackrohit.com" rel="noopener noreferrer"&gt;Photo Auditor&lt;/a&gt;. It finds duplicate photos and groups photos by the people in them, and it does all of it inside a browser tab. There is no backend. Your photos are never uploaded.&lt;/p&gt;

&lt;p&gt;Here is how the pieces fit together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading a folder without uploading it
&lt;/h2&gt;

&lt;p&gt;The File System Access API lets a page ask for a folder with &lt;code&gt;showDirectoryPicker()&lt;/code&gt;. The user picks one, the browser grants read access, and the page can walk every file and subfolder. Writing, renaming and deleting need a second, separate permission, which is a nice safety property: scanning can never change a file.&lt;/p&gt;

&lt;p&gt;The catch is browser support. Chrome and Edge on desktop have it. Safari, Firefox and phones do not, so the app says so up front instead of failing later.&lt;/p&gt;

&lt;p&gt;The app itself is Flutter Web. The file access, hashing and model code live in small JavaScript helpers, and Dart talks to them through &lt;code&gt;dart:js_interop&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding duplicates
&lt;/h2&gt;

&lt;p&gt;Two passes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Identical files.&lt;/strong&gt; Hash the file contents. Same hash means the same bytes, whatever the file is called. These are safe to pre-select for removal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Similar photos.&lt;/strong&gt; A difference hash (dHash) shrinks each image to a tiny greyscale grid and records whether each pixel is brighter than its neighbour. Resized or re-compressed copies end up with nearly the same bits, so a small Hamming distance means "same picture, saved differently". These are grouped but never selected automatically.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For each group, the suggested keeper is the copy with the most pixels, then the largest file, then the oldest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recognising faces locally
&lt;/h2&gt;

&lt;p&gt;Face work uses two small open models through ONNX Runtime Web:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;YuNet&lt;/strong&gt; finds faces and their landmarks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SFace&lt;/strong&gt; turns each aligned face into an embedding, a list of numbers where the same person lands close together.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Grouping is then a clustering problem over those embeddings. No clustering is perfect, so the UI makes fixing it cheap: merge two groups, move one face, or tighten the threshold without scanning again.&lt;/p&gt;

&lt;p&gt;"Find a person from a photo" is the same idea in reverse: embed the reference face, then rank every stored face by similarity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making the second visit fast
&lt;/h2&gt;

&lt;p&gt;A first scan of a big folder takes minutes. Results go into IndexedDB, so later visits only process new or changed files. Everything stored stays in the browser on that machine.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"Runs locally" is a feature people care about.&lt;/strong&gt; For family photos it is the whole pitch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Browsers cannot use the Trash.&lt;/strong&gt; A delete is permanent, so I added "Set aside", which moves copies to a review folder instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preview everything.&lt;/strong&gt; Renames and moves are shown as a full list before anything touches the disk, and the last run can be undone.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://photos.fullstackrohit.com" rel="noopener noreferrer"&gt;photos.fullstackrohit.com&lt;/a&gt; is free, with no account. It needs Chrome or Edge on a desktop.&lt;/p&gt;

&lt;p&gt;I would like to hear where it breaks, especially on large libraries.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>webdev</category>
      <category>privacy</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
