Spaces:
Runtime error
Runtime error
| 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) | |