Class RFDetrDetectionPreprocessor
Pré-processeur CPU pour les modèles de détection RF-DETR.
Pipeline appliqué à chaque image :
- Conversion BGR entrelacé → planaire (R, G, B).
- Redimensionnement bilinéaire direct vers la taille cible (StretchResize — pas de letterbox).
- Normalisation ImageNet par canal :
(pixel / 255 − mean) / std
avec mean = [0.485, 0.456, 0.406] et std = [0.229, 0.224, 0.225] (ordre RGB). - Layout de sortie :
NCHW float32— ordre des canaux RGB planar.
SAM2SegmentationPreprocessor, ce qui permet
une mutualisation optimale via le Hub partagé.
public class RFDetrDetectionPreprocessor : IRFDetrDetectionPreprocessor, IPreprocessor, IDisposable
- Inheritance
-
RFDetrDetectionPreprocessor
- Implements
- Inherited Members
Constructors
RFDetrDetectionPreprocessor()
public RFDetrDetectionPreprocessor()
Methods
BatchProcessBGR(byte[][], int[], int[], int, int, int)
Prétraite un batch d'images au format BGR.
public IDataHandlingResult BatchProcessBGR(byte[][] PackedBGRBatchBuffer, int[] widthsPerImage, int[] heightsPerImage, int batchSize, int targetWidth, int targetHeight)
Parameters
PackedBGRBatchBufferbyte[][]Tableau de buffers BGR, un par image.
widthsPerImageint[]Largeurs des images sources.
heightsPerImageint[]Hauteurs des images sources.
batchSizeintNombre d'images dans le batch.
targetWidthintLargeur cible après redimensionnement.
targetHeightintHauteur cible après redimensionnement.
Returns
- IDataHandlingResult
Un résultat de traitement contenant les données du batch prêtes pour l'inférence.
BatchProcessPlanar(byte[][], byte[][], byte[][], int[], int[], int, int, int)
Prétraite un batch d'images au format planaire.
public IDataHandlingResult BatchProcessPlanar(byte[][] PlanarBatchBuffer_R, byte[][] PlanarBatchBuffer_G, byte[][] PlanarBatchBuffer_B, int[] widthsPerImage, int[] heightsPerImage, int batchSize, int targetWidth, int targetHeight)
Parameters
PlanarBatchBuffer_Rbyte[][]Canaux rouges, un par image.
PlanarBatchBuffer_Gbyte[][]Canaux verts, un par image.
PlanarBatchBuffer_Bbyte[][]Canaux bleus, un par image.
widthsPerImageint[]Largeurs des images sources.
heightsPerImageint[]Hauteurs des images sources.
batchSizeintNombre d'images dans le batch.
targetWidthintLargeur cible après redimensionnement.
targetHeightintHauteur cible après redimensionnement.
Returns
- IDataHandlingResult
Un résultat de traitement contenant les données du batch prêtes pour l'inférence.
Dispose()
public void Dispose()
ProcessBGR(byte[], int, int, int, int)
Prétraite une seule image au format BGR.
public IDataHandlingResult ProcessBGR(byte[] PackedBGRBuffer, int imageWidth, int imageHeight, int targetWidth, int targetHeight)
Parameters
PackedBGRBufferbyte[]Buffer contenant l'image au format BGR entrelacé (B₀G₀R₀…).
imageWidthintLargeur de l'image source en pixels.
imageHeightintHauteur de l'image source en pixels.
targetWidthintLargeur cible après redimensionnement.
targetHeightintHauteur cible après redimensionnement.
Returns
- IDataHandlingResult
Un résultat de traitement contenant les données prêtes pour l'inférence.
ProcessPlanar(byte[], byte[], byte[], int, int, int, int)
Prétraite une seule image au format planaire (R, G, B séparés).
public IDataHandlingResult ProcessPlanar(byte[] PlanarBuffer_R, byte[] PlanarBuffer_G, byte[] PlanarBuffer_B, int imageWidth, int imageHeight, int targetWidth, int targetHeight)
Parameters
PlanarBuffer_Rbyte[]Canal rouge de l'image source.
PlanarBuffer_Gbyte[]Canal vert de l'image source.
PlanarBuffer_Bbyte[]Canal bleu de l'image source.
imageWidthintLargeur de l'image source en pixels.
imageHeightintHauteur de l'image source en pixels.
targetWidthintLargeur cible après redimensionnement.
targetHeightintHauteur cible après redimensionnement.
Returns
- IDataHandlingResult
Un résultat de traitement contenant les données prêtes pour l'inférence.