CharlesCNorton
Image-level person classification on EUPE-ViT-B features with no free parameters
e8b8483
Raw
History Blame Contribute Delete
892 Bytes
"""Filesystem and repository locations, overridable by environment.
BACKBONE HF repo id or local path for the backbone wrapper (alias: ARGUS_PATH)
BACKBONE_SRC local directory supplying argus.py (alias: ARGUS_SRC)
COCO_ROOT dataset root holding annotations/, train2017/, val2017/
DEVICE torch device string
"""
import os
from pathlib import Path
REPO = Path(__file__).resolve().parent.parent
UPSTREAM_BACKBONE = 'facebook/EUPE-ViT-B'
BACKBONE = os.environ.get('BACKBONE') or os.environ.get('ARGUS_PATH') or 'phanerozoic/argus'
BACKBONE_SRC = os.environ.get('BACKBONE_SRC') or os.environ.get('ARGUS_SRC') or None
COCO_ROOT = Path(os.environ.get('COCO_ROOT', '/home/zootest/datasets/coco'))
ARGUS = BACKBONE
def device() -> str:
if 'DEVICE' in os.environ:
return os.environ['DEVICE']
import torch
return 'cuda' if torch.cuda.is_available() else 'cpu'