Пример #1
0
def _model_init():
    p_model = pcn.Pnet()
    #p_model.apply(weight_init)
    p_model.cuda(DEVICE_IDS[0])
    p_model.train()
    return p_model
Пример #2
0
import tools_matrix_cpu as tools

threshold = [0.6, 0.6, 0.7]
EPS = 0.001

if __name__ == "__main__":
    #image_name = "images/25.jpg"
    #image_name = "images/yueyu.jpg"
    image_name = "images/qingxie.jpg"
    #image_name = "images/9.jpg"
    #image_name = "images/17.jpg"
    #image_name = "images/24.jpg"
    #image_name = "images/5.jpg"
    #image_name = "images/7.jpg"
    #image_name = "images/daozhi.jpg"
    pnet = pcn.Pnet()
    pnet.load_state_dict(
        torch.load("pnet/pnet_190310_iter_1238000_.pth",
                   map_location=lambda storage, loc: storage))
    pnet.eval()

    rnet = pcn.Rnet()
    rnet.load_state_dict(
        torch.load("rnet/pnet_190312_iter_979000_.pth",
                   map_location=lambda storage, loc: storage))
    rnet.eval()

    onet = pcn.Onet()
    onet.load_state_dict(
        torch.load("onet/onet_190227_iter_1499000_.pth",
                   map_location=lambda storage, loc: storage))