zhiqic / Rethinking-Counting

[CVPR 2022] Rethinking Spatial Invariance of Convolutional Networks for Object Counting
60 stars 12 forks source link

Where is the CrowdCounter class? #10

Closed BruceYounggit closed 11 months ago

BruceYounggit commented 12 months ago

In models/backbone/trainer.py, there occurs a problem, I can't find the CrowdCounter class.

import numpy as np

import torch
from torch import optim
from torch.autograd import Variable
from torch.optim.lr_scheduler import StepLR
from config import cfg
from misc.utils import *
import pdb
class Trainer():
    def __init__(self, dataloader, cfg_data, pwd):

        self.cfg_data = cfg_data

        self.data_mode = cfg.DATASET
        self.exp_name = cfg.EXP_NAME
        self.exp_path = cfg.EXP_PATH
        self.pwd = pwd

        self.net_name = cfg.NET
        self.net = CrowdCounter(cfg.GPU_ID,self.net_name).cuda()   # Here?!
        self.optimizer = optim.Adam(self.net.CCN.parameters(), lr=cfg.LR, weight_decay=1e-4)
        # self.optimizer = optim.SGD(self.net.parameters(), cfg.LR, momentum=0.95,weight_decay=5e-4)
        self.scheduler = StepLR(self.optimizer, step_size=cfg.NUM_EPOCH_LR_DECAY, gamma=cfg.LR_DECAY)
Tarandeep97 commented 5 months ago

@zhiqic Can you please indicate where is this Crowdcounter class?