

import evaluate
from tqdm import tqdm
model = AutoModelForObjectDetection.from_pretrained("devonho/detr-resnet-50_finetuned_cppe5")
module = evaluate.load("ybelkada/cocoevaluate", coco=test_ds_coco_format.coco)
val_dataloader = torch.utils.data.DataLoader(
     test_ds_coco_format, batch_size=8, shuffle=False, num_workers=4, collate_fn=collate_fn
 )
with torch.no_grad():
     for idx, batch in enumerate(tqdm(val_dataloader)):
         pixel_values = batch["pixel_values"]
         pixel_mask = batch["pixel_mask"]