Image formats and processing

I was wondering if DeepStack supports any other image formats than jpeg?
I know jpeg is easy, but I have some images in .png format, and i want to know if I have to convert them first before feeding them into DeepStack.

I would also like to know if pre-processing the images is of any use (or are they processed internally?). I ask because I have a training database (used for other facial recognition experiments) which has faces cropped, converted to black and white, and histogram normalized.

When comparing, I usually convert the live image to BW, histogram normalize, then use the image for facial recognition. This gives good results in day or night mode. I don’t know if this is needed though, as I don’t know what internal pre-processing DS does.

Does colour information matter? or am I better using BW for everything?

Hello, DeepStack supports most of the common image formats, there is no restriction. I would recommend avoiding preprocessing the images has deepstack has its own preprocessing.


I can’t pass it a numpy array in Cv2 format though (even when converted to a bytesarray), so I’m assuming you mean file formats…

Does colour make any difference? I ask because my camera images are monochrome at night (IR illumination), so generally I have been converting all images to monochrome, as colour information makes little difference to facial recognition (usually). Also processing of monochrome images is faster.


1 Like

I am interested in this one too.
@Nick_W were you able to figure this out by any chance?
I am converting a np.ndarray to bytes with tobytes() but it does not seem to work.
Which kind of format can we actually send to the API?

1 Like

@FraPochetti to address issues with formatting requests to DeepStack, we have started developing language specific SDKs.

You can use the DeepStack Python SDK by @john linked below. It makes it easy to process images and video without the need to write much code.

NB: In the example code detailed in the repo linked below, the detectObject() function supports any input

i.e OpenCV array, PIL image, file path.

johnolafenwa/DeepStackPython: Official Python SDK for DeepStack (

1 Like