Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions ai_stub.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from typing import Dict, List
from models import SmartAlbum, Photo


def _match_tag_against_name(tag: str, name: str) -> bool:
"""Simple matching: lowercase, check substring match to be robust to plurals.

WARNING: This is a naive stub that will produce false positives
(e.g., 'cat' matches 'concatenate'). Replace with word-boundary
matching or ML-based tagging for production use.
"""
return name.lower() in tag.lower() or tag.lower() in name.lower()


def refresh_album_contents(album: SmartAlbum, photos: Dict[str, Photo]) -> List[str]:
"""Return a list of photo ids appropriate for the album based on its type.

- For `object` albums we treat the album `name` as the target tag (e.g., "Cats").
- For `face` albums we return photos that have faces > 0.
- For `manual` or unknown types we return the existing `album.photos`.

This is a lightweight stub you can replace with real image recognition later.
"""
if album.type == "object":
target = album.name.strip().lower()
matched = []
for pid, p in photos.items():
for t in p.tags:
if _match_tag_against_name(t, target):
matched.append(pid)
break
return matched

if album.type == "face":
return [pid for pid, p in photos.items() if getattr(p, "faces", 0) > 0]

return album.photos
4 changes: 4 additions & 0 deletions backend/app/logging/setup_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def __init__(

def format(self, record: logging.LogRecord) -> str:
"""Format the log record with colors and component prefix."""
# Clear exc_info and stack_info before formatting
record.exc_info = None
record.stack_info = None

# Add component information to the record
component_prefix = self.component_config.get("prefix", "")
record.component = component_prefix
Expand Down
91 changes: 28 additions & 63 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,45 @@

PictoPy is a modern desktop app designed to transform the handling of digital photos. It facilitates efficient gallery management with a robust focus on privacy, offering smart tagging capabilities for photos based on objects, faces, or scenes.

<br>
<div style="text-align: center;">
<div style="text-align: center; margin: 2em 0;">
<img src="assets/AOSSIE-logo.png" alt="AOSSIE Logo" style="display:flex; margin:0 auto; justify-content: center;">
</div>

This project was announced by [AOSSIE](https://aossie.org/), an umbrella organization and was to be implemented from scratch. It provides features such as object detection and face similarity, offering smart tagging capabilities for photos based on objects, faces.

<div style="display:flex; margin:0 auto; justify-content: center;">
<div style="width:25%">
<h2>Overview</h2>
<ul>
<li><a href='./overview/features'>
Features
</a>
</li>
<li><a href='./overview/architecture'>
Architecture
</a>
</li>
---

## Documentation Sections

<div style="display:flex; margin: 2.5em auto; justify-content: center; gap: 1.75em; flex-wrap: wrap;">
<div style="width:25%; min-width: 220px;">
<h2 style="margin-top: 0; margin-bottom: 1.25em;">Overview</h2>
<ul style="padding-left: 0; list-style: none; margin: 0;">
<li style="margin-bottom: 0.75em;"><a href='./overview/features'>Features</a></li>
<li style="margin-bottom: 0.75em;"><a href='./overview/architecture'>Architecture</a></li>
</ul>
</div>
<div style="width:25%">
<h2>Backend Python</h2>
<ul>
<li>
<a href="./backend/backend_python/database">
Database
</a>
</li>
<li>
<a href="./backend/backend_python/directory-structure">
Directory Structure
</a>
</li>
<li>
<a href="./backend/backend_python/api">
API
</a>
</li>
<li>
<a href="./backend/backend_python/image-processing">
Image Processing
</a>
</li>
<div style="width:25%; min-width: 220px;">
<h2 style="margin-top: 0; margin-bottom: 1.25em;">Backend Python</h2>
<ul style="padding-left: 0; list-style: none; margin: 0;">
<li style="margin-bottom: 0.75em;"><a href="./backend/backend_python/database">Database</a></li>
<li style="margin-bottom: 0.75em;"><a href="./backend/backend_python/directory-structure">Directory Structure</a></li>
<li style="margin-bottom: 0.75em;"><a href="./backend/backend_python/api">API</a></li>
<li style="margin-bottom: 0.75em;"><a href="./backend/backend_python/image-processing">Image Processing</a></li>
</ul>
</div>
<div style="width:25%">
<h2>Backend Rust</h2>
<ul>
<li>
<a href="./backend/backend_rust/api">
API
</a>
</li>
<div style="width:25%; min-width: 220px;">
<h2 style="margin-top: 0; margin-bottom: 1.25em;">Backend Rust</h2>
<ul style="padding-left: 0; list-style: none; margin: 0;">
<li style="margin-bottom: 0.75em;"><a href="./backend/backend_rust/api">API</a></li>
</ul>
</div>
<div style="width:25%">
<h2>Frontend</h2>
<ul>
<li>
<a href="./frontend/ui-components">
UI Components
</a>
</li>
<li>
<a href="./frontend/state-management">
State Management
</a>
</li>
<li>
<a href="./frontend/gallery-view">
Gallery View
</a>
</li>
<div style="width:25%; min-width: 220px;">
<h2 style="margin-top: 0; margin-bottom: 1.25em;">Frontend</h2>
<ul style="padding-left: 0; list-style: none; margin: 0;">
<li style="margin-bottom: 0.75em;"><a href="./frontend/ui-components">UI Components</a></li>
<li style="margin-bottom: 0.75em;"><a href="./frontend/state-management">State Management</a></li>
<li style="margin-bottom: 0.75em;"><a href="./frontend/gallery-view">Gallery View</a></li>
</ul>
</div>
</div>
12 changes: 6 additions & 6 deletions docs/overview/features.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# PictoPy Features

### Gallery Application
## Gallery Application

- **Intelligent Photo Tagging**: Automatically tags photos based on detected objects, faces, and facial recognition.
- **Traditional Gallery Management**: Complete album organization and management tools.

### Advanced Image Analysis
## Advanced Image Analysis

- Object detection using **YOLOv11** for identifying various items in images
- Face detection and clustering powered by **FaceNet**.

### Privacy-Focused Design
## Privacy-Focused Design

- **Entirely offline**: All data stays on your local machine.
- No reliance on remote servers for processing.
- Models are stored locally and customizable by the user.

### Efficient Data Handling & Processing
## Efficient Data Handling & Processing

- Lightweight **SQLite** database for storing image metadata, face embeddings, and album info.
- Background image processing using `asyncio` for a smooth UI experience.

### Smart Search & Retrieval
## Smart Search & Retrieval

- Search photos based on:
- Detected objects
- Recognized faces
- Embedded metadata
- Find visually or semantically similar images

### Cross-Platform Compatibility
## Cross-Platform Compatibility

- Available on major operating systems (Windows, macOS, Linux)

Expand Down
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Setup Instructions

**Please refer to the [CONTRIBUTING.md](https://github.com/AOSSIE-Org/PictoPy/blob/main/CONTRIBUTING.md) file for complete setup instructions.**
Please refer to the [CONTRIBUTING.md](https://github.com/AOSSIE-Org/PictoPy/blob/main/CONTRIBUTING.md) file for complete setup instructions.

## Available Setup Methods

Expand Down
Loading