Skip to main content
The records page provides a comprehensive view of all license plate detections stored in your system. Each record includes the scanned image, detected license plate number, and associated metadata.

Accessing the Records Page

You can navigate to the records page in two ways:
  1. From the home page, click the ”📜 Ver Registros” (View Records) button
  2. Navigate directly to the /registros route in your browser
The records page is rendered by the registros() function (app.py:130-133), which loads all records from the CSV database and displays them in a structured table.

Understanding the Records Table

The records table displays the following columns for each entry:
All records are stored in data/registros.csv and loaded dynamically when you access the page.

Table Columns

ColumnDescription
IDUnique sequential identifier for each record
ImagenThumbnail preview of the uploaded license plate image
MatrículaThe detected license plate number (extracted via AI/OCR)
PropietarioOwner name or identifier (if provided during upload)
TipoVehicle type classification (e.g., sedan, truck, motorcycle)
Obs.Additional observations or notes about the vehicle
ActionsDelete button for removing individual records

Image Thumbnails

Each record displays a thumbnail of the original uploaded image. The thumbnails are served from the uploads/ directory via the /uploads/<filename> route (app.py:149-151).
Clicking or hovering over the thumbnail provides a visual confirmation of which vehicle the record refers to, making it easy to verify entries at a glance.

Managing Individual Records

Deleting a Record

To remove a record from the system:
1

Locate the Record

Find the record you want to delete in the table. Use the ID, license plate number, or image thumbnail to identify it.
2

Click the Delete Icon

Click the delete icon (trash can) in the rightmost column of the record’s row. This icon is rendered as delete.svg from the static assets.
3

Confirm Deletion

The system will immediately:
  • Remove the record from the CSV database
  • Delete the associated image file from the uploads/ directory
  • Redirect you back to the records page
  • Display a success message: “Registro eliminado correctamente”
Record deletion is permanent and cannot be undone. The delete operation removes both the database entry and the physical image file (app.py:135-147).

Records Page Features

Automatic Refresh

The records page loads fresh data from the CSV file each time you visit, ensuring you always see the most up-to-date information.

Flash Messages

The page displays flash messages at the top to inform you of:
  • Successful record deletions
  • Any errors that occur during operations
  • Status updates from other operations
Flash messages use a color-coded system:
  • Green background for success messages (category: “ok”)
  • Red/warning background for error messages (category: “error”)

Empty State

If no records exist in the system:
  • The table will display with headers but no data rows
  • You can return to the home page to add your first record
  • The CSV file will contain only the header row
The records page provides two primary navigation buttons:

Return to Upload

Click the ”⬅ Volver” (Back) button to return to the main upload interface where you can add new license plate records.

Export to CSV

Click the “Descargar CSV” (Download CSV) button to export all records to a CSV file. This is covered in detail in the Exporting Data guide.

Database Structure

Records are stored in a CSV file with the following structure:
id,fecha_hora,matricula,propietario,tipo_vehiculo,observacion,imagen
1,2024-03-04 15:30:45,ABC123,John Doe,Sedan,Red color,matricula_20240304_153045.jpg
2,2024-03-04 15:35:12,XYZ789,Jane Smith,Truck,Blue,matricula_20240304_153512.jpg
Each record includes:
  • id: Sequential numeric identifier
  • fecha_hora: Timestamp in “YYYY-MM-DD HH:MM:SS” format
  • matricula: Detected license plate text
  • propietario: Optional owner information
  • tipo_vehiculo: Optional vehicle type
  • observacion: Optional additional notes
  • imagen: Filename of the stored image
The CSV file is created automatically on first use (app.py:26-29) with proper headers to ensure data integrity.
Currently, the records table displays all entries in the database. For large datasets:
  • Records are displayed in the order they appear in the CSV file
  • You can use your browser’s built-in search (Ctrl+F or Cmd+F) to find specific entries
  • For advanced filtering, consider exporting to CSV and using spreadsheet software

Performance Considerations

Large Datasets

The current implementation loads all records into memory when rendering the page. For systems with hundreds or thousands of records:
  • Page load time may increase with more records
  • Consider implementing pagination for better performance
  • The CSV file size grows with each new record

Image Storage

All uploaded images are stored in the uploads/ directory:
  • Each image is saved with a unique timestamped filename
  • Images are retained even if the server restarts
  • Deleted records also remove their associated image files to conserve disk space
Monitor your uploads/ directory size if you’re processing many high-resolution images. Consider implementing image compression or archival strategies for production deployments.

Troubleshooting

Records Not Displaying

If the records page loads but shows no data:
  • Verify that data/registros.csv exists and contains data
  • Check that the CSV file has the correct headers
  • Ensure the Flask application has read permissions for the data directory

Images Not Loading

If thumbnails show broken image icons:
  • Verify the uploads/ directory exists and contains the referenced files
  • Check that image filenames in the CSV match actual files in uploads/
  • Ensure the Flask application has read permissions for the uploads directory

Delete Not Working

If clicking delete doesn’t remove records:
  • Verify the Flask application has write permissions for both the CSV file and uploads directory
  • Check browser console for any JavaScript errors
  • Ensure the record ID exists in the database

Build docs developers (and LLMs) love