Mastering Attendance Management: A Fusion of Flutter and Flask

Itba Malahat
Stackademic
Published in
2 min readMay 7, 2024

--

Photo by Joshua Woroniecki on Unsplash

In this article, we’ll explore the process of building a Smart Attendance System using Flutter for the front-end mobile application and Flask for the back-end server. This system utilizes facial recognition technology to automate the attendance marking process.

Back-End Development with Flask

We’ll start by developing the back-end server using Flask, a micro web framework for Python. The server will handle image uploads, perform facial recognition, and update attendance records. Let’s break down the key components of the Flask application:

  1. Imports and Setup: We import necessary libraries such as Flask, OpenCV for image processing, and DeepFace for facial recognition. We also define paths for model files and student data.
  2. Image Enhancement: The enhance_face function enhances the uploaded image to improve facial recognition accuracy by denoising and upscaling the image.
  3. Face Detection: We use the MTCNN (Multi-task Cascaded Convolutional Networks) algorithm to detect faces in the enhanced image.
  4. Facial Recognition: The evaluate_on_test_image function extracts facial embeddings using the VGG-Face model and predicts student identities using a pre-trained SVM classifier.
  5. Attendance Recording: Detected student names are written to an Excel sheet to record attendance.
  6. API Endpoint: We define a Flask route /upload to handle image uploads and attendance processing.

Front End Development with Flutter

Now, let’s move on to developing the front-end mobile application using Flutter, a UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase. Here’s a breakdown of the key components of the Flutter application:

  1. Initializing Camera: We initialize the camera for capturing images by accessing device cameras using the camera package.
  2. Image Capture: Users can either capture a photo using the device camera or select an existing image from the gallery.
  3. Image Upload: Selected images are sent to the Flask server for attendance processing via HTTP POST requests.
  4. Feedback Handling: Users receive feedback messages via a SnackBar widget indicating the success or failure of image uploads.

By combining Flutter for the front-end and Flask for the back-end, we’ve created a Smart Attendance System capable of automating attendance marking through facial recognition. This project demonstrates the power of integrating different technologies to solve real-world problems efficiently.

So, if you’re interested in exploring the exciting realms of mobile app development and facial recognition, give Flutter and Flask a try, and embark on your journey to building innovative solutions!

Stackademic 🎓

Thank you for reading until the end. Before you go:

--

--

CS undergrad navigating through the world of tech and occasionally documenting her explorations.