Detect and blur faces in flutter using pixlab API

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • pixlab

    PixLab Resources & Code Samples

  • import 'package:flutter/material.dart'; import 'package:dio/dio.dart'; void main() { runApp( const MaterialApp( home: FaceBlurPage(), ), ); } class FaceBlurPage extends StatefulWidget { const FaceBlurPage({super.key}); @override State createState() => _FaceBlurPageState(); } class _FaceBlurPageState extends State { String pixlabkey = "74389de25cb37a10adf615e8a79c8da4"; String imagelink = "https://pixlab.io/images/m3.jpg"; String? blurImagelink; // Instentiating Dio var dio = Dio(); // Detect faces using pixlab API Future detectFaces(String image) async { return dio.get( "https://api.pixlab.io/facedetect", queryParameters: { "img": image, "key": pixlabkey, }, ); } // Blurring faces using facial coordinates Future blurface(String image, List coordinates) async { return await dio.post( "https://api.pixlab.io/mogrify", data: { "img": image, "key": pixlabkey, "cord": coordinates, }, options: Options(contentType: "application/json"), ); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Face Blur Example"), ), body: Column( children: [ Image.network(imagelink), blurImagelink != null ? Image.network(blurImagelink!) : const Text("No image provided"), ], ), floatingActionButton: FloatingActionButton( onPressed: () async { Response faces = await detectFaces(imagelink); Response blurfaceImageResponse = await blurface(imagelink, faces.data["faces"]); setState(() { blurImagelink = blurfaceImageResponse.data["ssl_link"]; }); }, child: const Icon(Icons.auto_mode_rounded), ), ); } }

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts