a ne@sJddlmZddlmZmZddlZddlmZeeeddddZdS))fields)AnyListN) Instances)densepose_predictor_output detectionsreturnc Csd}|D]}|durq|}t|}i}t|D]>}t||j}t|tjrf||||||j<q2|||j<q2|fi||_||7}qdS)a2 Splits DensePose predictor outputs into chunks, each chunk corresponds to detections on one image. Predictor output chunks are stored in `pred_densepose` attribute of the corresponding `Instances` object. Args: densepose_predictor_output: a dataclass instance (can be of different types, depending on predictor used for inference). Each field can be `None` (if the corresponding output was not inferred) or a tensor of size [N, ...], where N = N_1 + N_2 + .. + N_k is a total number of detections on all images, N_1 is the number of detections on image 1, N_2 is the number of detections on image 2, etc. detections: a list of objects of type `Instance`, k-th object corresponds to detections on k-th image. rN) __len__typergetattrname isinstancetorchTensorpred_densepose) rrkZ detection_iZn_iZPredictorOutputZ output_i_dictfieldZ field_valuerL/home/alin0222/detectron2/projects/DensePose/densepose/modeling/inference.pydensepose_inference s    r) dataclassesrtypingrrrdetectron2.structuresrrrrrrs