Fine-tuning scripts

#1
by mooov252 - opened

I've posted this comment on reddit under your announcement post - but it's not showing up in the discussion somehow.

Amazing work!
Will there be any fine-tuning scripts available?

I've been using ben2 for processing our OF content, but it still required finetuning - it sometimes wasn't detecting subjects on images because people are dressed in latex from head to toe, sometimes - with no face visible at all. Sometimes it detected the bed sheets together with a person, etc.

The end goal was to process hours of video, taken from multiple cameras.

There were no fine-tuning scripts available so I created them (with help of llms) and successfully fine-tuned it on my custom dataset (around 10k image-mask pairs). Then I slightly adapted the network code to be efficiently onnx-exported, wrote an exporter, converted it to a TensorRT engine and wrote a custom trt video processing pipeline.

It was running around 30fps on 4090 in fp16 and was correctly separating bg from fg, but still was flickering quite a lot (since it's a single frame model). So I tried to reduce the flicker in videos - updated the pipeline to use kalman accumulation/stabilization and two passes per frame (original and horizontally mirrored), some other hacks. It halved the fps but was giving better results.

After this I decided to adapt it to video myself to reduce flickering further. I've experimented with adding multi-frame attention and precomputed optical flow inputs to the network, reduced flickering a bit further but it wasn't that dramatic - still flickering, but acceptable. I've been running it like that for all my content for around a year now.

Here's a video of some of my experiments: https://www.youtube.com/watch?v=9WxV8aidxBY

I'm very excited to try BEN3 now. Of course, if there are any fine-tuning and onnx exporting scripts already available - it would be a huge help. However I'll try to test it on my existing test clips first - maybe it won't require fine-tuning.

Sign up or log in to comment