Beispiel #1
0
    def load_model(self):
        cnn_arch = self.hparams['graph_model_params']['cnn_params']['arch']
        model =  MOTMPNet(self.hparams['graph_model_params']).cuda()

        cnn_model = resnet50_fc256(10, loss='xent', pretrained=True).cuda()
        load_pretrained_weights(cnn_model,
                                osp.join(OUTPUT_PATH, self.hparams['graph_model_params']['cnn_params']['model_weights_path'][cnn_arch]))
        cnn_model.return_embeddings = True

        return model, cnn_model
Beispiel #2
0
    def load_model(self):
        model = MOTMPNet(self.hparams["graph_model_params"]).cuda()

        cnn_model = resnet50_fc256(10, loss="xent", pretrained=True).cuda()
        load_pretrained_weights(
            cnn_model,
            self.reid_weights_path,
        )
        cnn_model.return_embeddings = True

        return model, cnn_model
Beispiel #3
0
    def load_model(self):
        cnn_arch = self.hparams["graph_model_params"]["cnn_params"]["arch"]

        if (
            "multi" not in self.hparams["graph_model_params"]
            or not self.hparams["graph_model_params"]["multi"]
        ):
            model = MOTMPNet(self.hparams["graph_model_params"]).cuda()
        else:
            model = CombinedMOTMPNet(self.hparams["graph_model_params"]).cuda()

        cnn_model = resnet50_fc256(10, loss="xent", pretrained=True).cuda()
        load_pretrained_weights(
            cnn_model,
            osp.join(
                OUTPUT_PATH,
                self.hparams["graph_model_params"]["cnn_params"]["model_weights_path"][
                    cnn_arch
                ],
            ),
        )
        cnn_model.return_embeddings = True

        return model, cnn_model