This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Single Responsibility Principle | |
“…You had one job” — Loki to Skurge in Thor: Ragnarok | |
A class should have only one job. | |
If a class has more than one responsibility, it becomes coupled. | |
A change to one responsibility results to modification of the other responsibility. | |
""" | |
class Animal: | |
def __init__(self, name: str): |