edgefirst-hal 0.7.0

EdgeFirst Hardware Abstraction Layer for edge AI inference pipelines
Documentation

edgefirst-hal

Crates.io Documentation License

EdgeFirst Hardware Abstraction Layer - A unified Rust library for edge AI inference pipelines.

This is the umbrella crate that re-exports the core EdgeFirst HAL components:

Features

  • Zero-copy memory management with DMA-BUF and POSIX shared memory support
  • Hardware-accelerated image processing via G2D (NXP i.MX) and OpenGL
  • Efficient ML post-processing for object detection and segmentation models
  • Cross-platform - Linux (with hardware acceleration), macOS, and other Unix systems

Quick Start

use edgefirst_hal::{tensor, image, decoder};

// Create a tensor with automatic memory selection
let tensor = tensor::Tensor::<f32>::new(&[1, 3, 640, 640], None, None)?;

// Load and process an image
let img = image::TensorImage::load(&image_bytes, Some(image::RGBA), None)?;
let mut processor = image::ImageProcessor::new()?;
processor.convert(&img, &mut dst, image::Rotation::None, image::Flip::None, image::Crop::default())?;

// Decode YOLO model outputs
let decoder = decoder::DecoderBuilder::new()
    .with_score_threshold(0.25)
    .with_iou_threshold(0.7)
    .build()?;

Platform Support

Platform Memory Types Image Acceleration
Linux (i.MX8) DMA, SHM, Mem G2D, OpenGL, CPU
Linux (other) SHM, Mem OpenGL, CPU
macOS SHM, Mem CPU
Other Unix SHM, Mem CPU

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Links