Full-stack application for predicting where humans look in images using DeepGaze saliency models. Includes heatmap overlays, gaze sequence prediction, hotspot detection, AOI analysis, rule-based insights, optional Claude AI design analysis, and professional PDF report generation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
867 B
Python
23 lines
867 B
Python
import uuid
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import ForeignKey, JSON, String, func
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
from app.models.base import Base
|
|
|
|
|
|
class Comparison(Base):
|
|
__tablename__ = "comparisons"
|
|
|
|
id: Mapped[str] = mapped_column(
|
|
String(36), primary_key=True, default=lambda: str(uuid.uuid4())
|
|
)
|
|
project_id: Mapped[str] = mapped_column(ForeignKey("projects.id"), index=True)
|
|
user_id: Mapped[str] = mapped_column(String(36), index=True)
|
|
name: Mapped[str] = mapped_column(String(255))
|
|
analysis_ids: Mapped[dict] = mapped_column(JSON)
|
|
comparison_data: Mapped[dict | None] = mapped_column(JSON, nullable=True)
|
|
created_at: Mapped[datetime] = mapped_column(server_default=func.now())
|
|
|
|
project: Mapped["Project"] = relationship(back_populates="comparisons") # noqa: F821
|