How to out-of-place buffering using dsexample/gstnvsegvisual demo code

OK, I understand your requirement.
One possible solution is to run two pipelines, one for detection and the other is for segmentation. So that the in-place transformation will not impact other pipeline.
The other solution is to develop your own normal transform plugin, Qustion of memory leak gst-plugin based on dsexample - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums is a good sample. You need to design your prepare_output function carefully.