first commit
1
.cursorignore
Normal file
@ -0,0 +1 @@
|
||||
public/images
|
||||
24
.gitignore
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
106
README.md
Normal file
@ -0,0 +1,106 @@
|
||||
# LAPD Face Search
|
||||
|
||||
A web application that allows users to search through over 9,000 LAPD officer headshots using facial recognition technology. The application runs entirely in the browser, ensuring privacy by processing images locally without uploading them to any server.
|
||||
|
||||
## Features
|
||||
|
||||
- **Privacy-First**: All face recognition processing happens locally in your browser
|
||||
- **Large Database**: Search through 9,000+ LAPD officer headshots
|
||||
- **Real-Time Matching**: Upload a photo and get instant matches
|
||||
- **Officer Information**: View officer names, serial numbers, and links to detailed profiles
|
||||
- **Responsive Design**: Works on desktop and mobile devices
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Upload a Photo**: Select an image containing a face you want to identify
|
||||
2. **Face Detection**: The app automatically detects faces in your uploaded image
|
||||
3. **Feature Extraction**: Facial features are extracted and converted to mathematical descriptors
|
||||
4. **Database Search**: Your face is compared against all officers in the database
|
||||
5. **Results Display**: Top matches are shown with similarity scores and officer information
|
||||
|
||||
## Technology Stack
|
||||
|
||||
- **Frontend**: Svelte 5 with Vite
|
||||
- **Face Recognition**: [@vladmandic/face-api](https://github.com/vladmandic/face-api) (TensorFlow.js-based)
|
||||
- **Models**: SSD MobileNet v1 face detection, face landmark detection model, face recognition network
|
||||
- **Data**: Pre-processed face descriptors and metadata for 9,000+ officers
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
lapd-face-search/
|
||||
├── public/
|
||||
│ ├── analysis/
|
||||
│ │ ├── lapd_descriptors.bin # Pre-computed face descriptors
|
||||
│ │ └── lapd_metadata.json # Officer metadata (names, serials, etc.)
|
||||
│ └── models/ # TensorFlow.js face recognition models
|
||||
├── src/
|
||||
│ ├── App.svelte # Main application component
|
||||
│ ├── Cop.svelte # Individual officer display component
|
||||
│ ├── app.css # Global styles
|
||||
│ └── main.js # Application entry point
|
||||
├── index.html # HTML template
|
||||
└── package.json # Dependencies and scripts
|
||||
```
|
||||
|
||||
## Installation & Setup
|
||||
|
||||
1. **Clone the repository**:
|
||||
```bash
|
||||
git clone <repository-url>
|
||||
cd lapd-face-search
|
||||
```
|
||||
|
||||
2. **Install dependencies**:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
3. **Start development server**:
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
4. **Build for production**:
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
1. Open the application in your web browser
|
||||
2. Wait for the face recognition models to load (this may take a few moments)
|
||||
3. Click "Select Photo" to upload an image containing a face
|
||||
4. The app will automatically process the image and display potential matches
|
||||
5. Click on any match to view the officer's profile on WatchTheWatchers.net
|
||||
|
||||
## Privacy & Security
|
||||
|
||||
- **No Server Uploads**: Images are processed entirely in your browser
|
||||
- **Local Processing**: Face recognition models run locally using TensorFlow.js
|
||||
- **No Data Collection**: The application does not collect or store any uploaded images
|
||||
- **Open Source**: All code is open source and can be audited for privacy compliance
|
||||
|
||||
## Data Sources
|
||||
|
||||
The officer database includes:
|
||||
- Officer headshots from [public records](https://watchthewatchers.net/)
|
||||
- Names and serial numbers
|
||||
- Pre-computed facial descriptors for fast matching
|
||||
|
||||
## Technical Details
|
||||
|
||||
### Face Recognition Pipeline
|
||||
|
||||
1. **Face Detection**: Uses SSD MobileNet v1 to detect faces in images
|
||||
2. **Landmark Detection**: Extracts 68 facial landmarks for alignment
|
||||
3. **Feature Extraction**: Generates 128-dimensional face descriptors
|
||||
4. **Similarity Matching**: Compares descriptors using Euclidean distance
|
||||
5. **Ranking**: Returns top 9 matches sorted by similarity
|
||||
|
||||
### Performance
|
||||
|
||||
- **Initial Load**: ~50MB of models and data (one-time download)
|
||||
- **Processing Speed**: ~1-3 seconds per image
|
||||
- **Accuracy**: Optimized for clear, front-facing photos
|
||||
- **Browser Support**: Modern browsers with WebGL support
|
||||
12
index.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>LAPD Facial Recognition</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
32
jsconfig.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "bundler",
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
/**
|
||||
* svelte-preprocess cannot figure out whether you have
|
||||
* a value or a type, so tell TypeScript to enforce using
|
||||
* `import type` instead of `import` for Types.
|
||||
*/
|
||||
"verbatimModuleSyntax": true,
|
||||
"isolatedModules": true,
|
||||
"resolveJsonModule": true,
|
||||
/**
|
||||
* To have warnings / errors of the Svelte compiler at the
|
||||
* correct position, enable source maps by default.
|
||||
*/
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
/**
|
||||
* Typecheck JS in `.svelte` and `.js` files by default.
|
||||
* Disable this if you'd like to use dynamic types.
|
||||
*/
|
||||
"checkJs": true
|
||||
},
|
||||
/**
|
||||
* Use global.d.ts instead of compilerOptions.types
|
||||
* to avoid limiting type declarations.
|
||||
*/
|
||||
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
|
||||
}
|
||||
1236
package-lock.json
generated
Normal file
19
package.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "lapd",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||
"svelte": "^5.28.1",
|
||||
"vite": "^6.3.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vladmandic/face-api": "^1.7.15"
|
||||
}
|
||||
}
|
||||
BIN
public/analysis/lapd_descriptors.bin
Normal file
1
public/analysis/lapd_metadata.json
Normal file
BIN
public/images/ABADMIGUELANGEL-42963.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
public/images/ABALOSJILVEE-39951.jpg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/images/ABANOBIATULAEGWU-40662.jpg
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
public/images/ABARCAVICTOR-39125.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/images/ABDALIANDAVIDA-34450.jpg
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
public/images/ABDULRAHMANSALAAM-25823.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/images/ABIVATHORA-44313.jpg
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
public/images/ABLAZASTUARTE-38380.jpg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/images/ABNEYKELSEYD-44458.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ABOAL-FREIRECRISTOBAL-42612.jpg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
public/images/ABOLFAZLIANAMIR-36802-Copy.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/images/ABORDOTROYS-32515.jpg
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
public/images/ABOYTECHRISTOPHERB-41906.jpg
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
public/images/ABRAHAMMARVINM-42098.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
public/images/ABSKHARONPETERA-33648.jpg
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
public/images/ABUCEJOBENEDICTR-30534.jpg
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
public/images/ABULEIJONATHANA-44956.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ABUNDISALEJANDRO-39079.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/images/ACEDILLOEDWARDV-41485.jpg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
public/images/ACEEDAVIDM-38221.jpg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/images/ACEROARMANDOG-33103.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
public/images/ACEVEDOFRANCISCO-42386.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/images/ACEVEDOHERREROHENRY-45070.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ACEVEDOJASONL-33768.jpg
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/images/ACEVEDOJR.JUAN-42824.jpg
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
public/images/ACEVEDORICARDO-33769.jpg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/images/ACEVEDOSANDYT-38973.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/images/ACEVEDOVICTORH-33001.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
public/images/ACEVESDAVID-42569.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/images/ACEVESFRANCISCO-40434.jpg
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
public/images/ACEVESHECTOR-35717.jpg
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
public/images/ACEVESJOHANNA-38077.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ACEVESLUISM-38381.jpg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/images/ACEVESMARKA-30924-Copy.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
public/images/ACEVESMILAGROS-43747.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ACEVESPERLAN-41134.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/images/ACEVESULYSSES-38171.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/images/ACHAKZAIWARRIS-43439.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
public/images/ACKERLEYFREDDIER-33525.jpg
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
public/images/ACOSTAADRIAND-37285.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ACOSTAANTHONYU-34379.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/images/ACOSTACARLOS-42825.jpg
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
public/images/ACOSTACARLOSR-42873.jpg
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
public/images/ACOSTAERICD-43235.jpg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/images/ACOSTAGABRIEL-43673.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/images/ACOSTAJOHNJ-37464.jpg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/images/ACOSTAJR.WILLIAMO-38609.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ACOSTAJUANM-36200.jpg
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
public/images/ACOSTALORENA-44803.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ACOSTAMICHAELA-30535.jpg
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
public/images/ACOSTARICARDOM-32516.jpg
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
public/images/ACOSTARICHARDA-36470.jpg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
public/images/ACOSTATYRONER-27558.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ACQUAVIVAMARKA-37987.jpg
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
public/images/ACUNACHRISTOPHER-43590.jpg
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
public/images/ACUNAERNIE-36704.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
public/images/ACUNALUISFRENZEN-43920.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
public/images/ADAIRRICHARDL-36417.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
public/images/ADAMBRUCEM-30978.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
public/images/ADAMEMARIO-32425.jpg
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
public/images/ADAMSCRAIGS-31398.jpg
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
public/images/ADAMSGERALDL-37315.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
public/images/ADAMSGLENNG-34837.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ADAMSROSEANNH-37329.jpg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
public/images/ADAMSSARAHE-42481.jpg
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/images/ADAMSTIMOTHYJ-44638.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/images/ADAMSTYLERP-37859.jpg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
public/images/ADKINSJASOND-35881.jpg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
public/images/ADLERZACHARY-43994.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/images/ADRAGNAJOSEPH-36659.jpg
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
public/images/ADRIANOCHRISTYD-36108.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
public/images/AESCHLIMANPAULS-33888.jpg
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
public/images/AFFULRICHMOND-38722.jpg
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/images/AFREMOWASHLEY-42918.jpg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
public/images/AFSHARKIYAN-42672.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/images/AGBANAWAGROYE-30422.jpg
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
public/images/AGDEPPAEDWARD-41000.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/images/AGENAASHURA-38025.jpg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/images/AGNEWRACHELD-30536.jpg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
public/images/AGUAYOALFREDO-35749.jpg
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/images/AGUAYOANDY-27912.jpg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/images/AGUAYOVICTOR-42826.jpg
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
public/images/AGUIARALFONSO-43390.jpg
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
public/images/AGUIARVANESSA-44804.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/images/AGUILAANTONIO-39024.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/images/AGUILAHERNANDEZJUANC-43315.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
public/images/AGUILAJESSICA-43124.jpg
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/images/AGUILARALEXI-44038.jpg
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/images/AGUILARCHRISTOPHER-43556.jpg
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
public/images/AGUILARDIEGO-39430.jpg
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
public/images/AGUILARESTEBAN-42482.jpg
Normal file
|
After Width: | Height: | Size: 4.1 KiB |