first commit
This commit is contained in:
20
backend/app/models/ocr_block.py
Normal file
20
backend/app/models/ocr_block.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import String, Integer, Float, Text, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import UUID, JSONB
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.core.database import Base
|
||||
|
||||
|
||||
class OcrBlock(Base):
|
||||
__tablename__ = "ocr_blocks"
|
||||
|
||||
id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
image_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("evidence_images.id"), index=True)
|
||||
content: Mapped[str] = mapped_column(Text, default="")
|
||||
bbox: Mapped[dict] = mapped_column(JSONB, default=dict)
|
||||
seq_order: Mapped[int] = mapped_column(Integer, default=0)
|
||||
confidence: Mapped[float] = mapped_column(Float, default=0.0)
|
||||
|
||||
image = relationship("EvidenceImage", back_populates="ocr_blocks")
|
||||
Reference in New Issue
Block a user