Adding Preprocessing to Frames RTSP

I would like to add a clearer explanation of my intentions.

I aim to process inputs coming from RTSP streamings (e.g. IP cameras).
Those inputs are black and white.
Pretrained models do not have good performance on those inputs. I guess that this happens because the models have been trained on a color image dataset.

I have done some tests and I have reported an increment in the performance if I simply apply a color filter (e.g. sepia effect) on the images.
Thus, I aim to insert in the pipeline that filtering effect on the inputs.
Please see the following diagram for a clearer explanation:


I have all the pipeline already working. What is missing is the pre-processing.
I hope you could give me some advice, for I am stuck in a dead end.
(I am also open to learn alternative solutions.)

Thanks again!