pi3
pi3
#
Pi3X, run by cgr.depth inside the GPU interpreter.
Only torch, numpy and PIL are imported here, never capturegraph: this is a
standalone script, so its argument parsing, image loading and output writing
are its own (depth_anything_3.py repeats them for the same reason). Pi3X
is a multi-view model; without --multiview it is run one image at a
time. It outputs no intrinsics, so the focal length is recovered from the
local point map it predicts; the principal point is taken as the image
centre.
python pi3.py --images DIR --weights DIR --output DIR [--multiview]
Reads NNNNN.<ext> from --images in sorted order and writes, per image,
NNNNN.npy (float32 depth) and NNNNN_conf.npy (float32 confidence in
[0, 1]) into --output. With --multiview the images are posed
together and cameras.json (camera-to-world 4×4 and pixel intrinsics per
image, OpenCV convention), points.npy (N×3 float32) and colors.npy
(N×3 uint8) are written beside them.
main()
#
Predict depth for every staged image and write the contract's outputs.