Spaces:
Runtime error
Runtime error
File size: 965 Bytes
44f7c73 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
from sqlalchemy import Column, String, Float, Integer, DateTime, Text
from datetime import datetime
from .db import Base
class Detection(Base):
__tablename__ = "detections"
detection_id = Column(String, primary_key=True)
image_filename = Column(String)
gps_latitude = Column(Float)
gps_longitude = Column(Float)
total_detections = Column(Integer)
created_at = Column(DateTime, default=datetime.now)
class DetectionResult(Base):
__tablename__ = "detection_results"
id = Column(Integer, primary_key=True, autoincrement=True)
detection_id = Column(String)
class_name = Column(String)
confidence = Column(Float)
severity = Column(String) # light, medium, heavy
gps_latitude = Column(Float)
gps_longitude = Column(Float)
bbox_x1 = Column(Integer)
bbox_y1 = Column(Integer)
bbox_x2 = Column(Integer)
bbox_y2 = Column(Integer)
created_at = Column(DateTime, default=datetime.now)
|