Here is my idea :
- Take the depth image provided by your camera
- If you only want to detect objects (and not other obstacles), modify this depth image by setting pixels outside the objects bounding boxes to a large value.
- use depthimage_to_laserscan to convert this depth image to a laserscan.
- Integrate the laserscan with your costmap
If performance is not an issue, you can directly integrate the depth image as a Voxel Layer by converting it to a PointCloud (http://wiki.ros.org/depth_image_proc) so that you have 3D object avoidance (meaning that your device will be able to say "ok there is an obstacle but it is above me so I can still go through"). If you don't need this feature, convert it using step 3.
You can also take a look at http://wiki.ros.org/spatio_temporal_voxel_layer for the integration of your laser scan or depth image with your costmap.
As an example of prior art:
Here's a guy that did it with Tensor flow and a kinect camera for the object and depth detection. YOLO and Realsense is not so different in application.
I'm not saying his code will work for you, but always a good idea to study those that came before you.