feat: Enhance photo identification and tagging features with new filters and counts

This commit introduces several enhancements to the photo identification and tagging functionalities. The Identify component now supports filtering by photo IDs, allowing users to view faces from specific photos. Additionally, the Tags component has been updated to include an unidentified face count for each photo, improving user awareness of untagged faces. The API has been modified to accommodate these new parameters, ensuring seamless integration with the frontend. Documentation has been updated to reflect these changes.
This commit is contained in:
tanyar09
2025-11-12 14:17:16 -05:00
parent 89a63cbf57
commit cfb94900ef
10 changed files with 404 additions and 74 deletions
+79 -11
View File
@@ -116,7 +116,9 @@ The web version uses the **exact same schema** as the desktop version for full c
redis-server
```
**Terminal 2 - Backend API (automatically starts RQ worker):**
#### Option 1: Manual Start (Recommended for Development)
**Terminal 1 - Backend API:**
```bash
cd /home/ladmin/Code/punimtag
source venv/bin/activate
@@ -126,33 +128,99 @@ uvicorn src.web.app:app --host 127.0.0.1 --port 8000
You should see:
```
✅ Database already initialized (7 tables exist)
✅ RQ worker started in background subprocess (PID: ...)
INFO: Started server process
INFO: Uvicorn running on http://127.0.0.1:8000
```
**Note:** The RQ worker automatically starts in a background subprocess when the API starts. You'll see a confirmation message with the worker PID. If Redis isn't running, you'll see a warning message.
**Terminal 3 - Frontend:**
**Terminal 2 - Frontend:**
```bash
cd /home/ladmin/Code/punimtag/frontend
npm run dev
```
Then open your browser to **http://localhost:3000**
You should see:
```
VITE v5.4.21 ready in 811 ms
➜ Local: http://localhost:3000/
```
**Default Login:**
- Username: `admin`
- Password: `admin`
#### Option 2: Using Helper Script (Backend + Worker)
**Terminal 1 - Backend API + Worker:**
```bash
cd /home/ladmin/Code/punimtag
./run_api_with_worker.sh
```
This script will:
- Check if Redis is running (start it if needed)
- Start the RQ worker in the background
- Start the FastAPI server
- Handle cleanup on Ctrl+C
**Terminal 2 - Frontend:**
```bash
cd /home/ladmin/Code/punimtag/frontend
npm run dev
```
#### Access the Application
1. Open your browser to **http://localhost:3000**
2. Login with default credentials:
- Username: `admin`
- Password: `admin`
3. API documentation available at **http://127.0.0.1:8000/docs**
#### Troubleshooting
**Port 8000 already in use:**
```bash
# Find and kill the process using port 8000
lsof -i :8000
kill <PID>
# Or use pkill
pkill -f "uvicorn.*app"
```
**Port 3000 already in use:**
```bash
# Find and kill the process using port 3000
lsof -i :3000
kill <PID>
# Or change the port in frontend/vite.config.ts
```
**Redis not running:**
```bash
# Start Redis
sudo systemctl start redis-server
# Or
redis-server
```
**Database issues:**
```bash
# Recreate all tables (WARNING: This will delete all data!)
cd /home/ladmin/Code/punimtag
source venv/bin/activate
export PYTHONPATH=/home/ladmin/Code/punimtag
python scripts/recreate_tables_web.py
```
#### Important Notes
**Note:**
- The database and tables are **automatically created on first startup** - no manual setup needed!
- The RQ worker starts automatically in a background subprocess when the API server starts
- Make sure Redis is running first, or the worker won't start
- Worker names are unique to avoid conflicts when restarting
- Photo uploads are stored in `data/uploads` (configurable via `PHOTO_STORAGE_DIR` env var)
- **DeepFace models download automatically on first use** (can take 5-10 minutes)
- **If port 8000 is in use**, kill the process: `lsof -i :8000` then `kill <PID>` or `pkill -f "uvicorn.*app"`
- **DeepFace models download automatically on first use** (can take 5-10 minutes, ~100MB)
- First run is slower due to model downloads (subsequent runs are faster)
---