olivas/backend/app/models/aoi.py
DJP 3467dbcf03 Initial commit — OliVAS visual attention analysis platform
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>
2026-02-23 20:20:58 -05:00

26 lines
971 B
Python

import uuid
from sqlalchemy import Float, ForeignKey, Integer, String
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.models.base import Base
class AOI(Base):
__tablename__ = "aois"
id: Mapped[str] = mapped_column(
String(36), primary_key=True, default=lambda: str(uuid.uuid4())
)
analysis_id: Mapped[str] = mapped_column(ForeignKey("analyses.id"), index=True)
label: Mapped[str] = mapped_column(String(100))
x: Mapped[int] = mapped_column(Integer)
y: Mapped[int] = mapped_column(Integer)
width: Mapped[int] = mapped_column(Integer)
height: Mapped[int] = mapped_column(Integer)
attention_pct: Mapped[float | None] = mapped_column(Float, nullable=True)
area_pct: Mapped[float | None] = mapped_column(Float, nullable=True)
attention_density: Mapped[float | None] = mapped_column(Float, nullable=True)
analysis: Mapped["Analysis"] = relationship(back_populates="aois") # noqa: F821