Skip to content

Instantly share code, notes, and snippets.

View StevanCakic's full-sized avatar
🎯
Focusing

Stevan Čakić StevanCakic

🎯
Focusing
View GitHub Profile
@ortegatron
ortegatron / LossEvalHook.py
Last active April 2, 2025 08:32
Trainer with Loss on Validation for Detectron2
from detectron2.engine.hooks import HookBase
from detectron2.evaluation import inference_context
from detectron2.utils.logger import log_every_n_seconds
from detectron2.data import DatasetMapper, build_detection_test_loader
import detectron2.utils.comm as comm
import torch
import time
import datetime
class LossEvalHook(HookBase):