isl-org / MiDaS

Code for robust monocular depth estimation described in "Ranftl et. al., Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-shot Cross-dataset Transfer, TPAMI 2022"
MIT License
4.52k stars 624 forks source link

Combining yolov8 with midas #223

Open ElNino9495 opened 1 year ago

ElNino9495 commented 1 year ago

How do i apply midas to a particular pixel such that it inly applies to the centroid of the bounding box of an object detection label of yolo v8

Sid1057 commented 1 year ago

If I understood your request correctly, then the easiest way is to apply midas to the entire image, take a box crop, and then inside the crop, either select the center pixel, or find the pixel with the highest value (for example, using np.max or cv.minMaxLoc)