6b672ac6a0c6bbc41f89d3e4bc528b937363e032,test.py,,extract_feature,#Any#Any#,139

Before Change


            //if opt.fp16:
            //    input_img = input_img.half()
            outputs = model(input_img) 
            f = outputs.data.cpu().float()
            ff = ff+f
        // norm feature
        if opt.PCB:
            // feature size (n,2048,6)
            // 1. To treat every part equally, I calculate the norm for every 2048-dim part feature.

After Change


        n, c, h, w = img.size()
        count += n
        print(count)
        ff = torch.FloatTensor(n,512).zero_().cuda()
        if opt.PCB:
            ff = torch.FloatTensor(n,2048,6).zero_().cuda() // we have six parts

        for i in range(2):
            if(i==1):
                img = fliplr(img)
            input_img = Variable(img.cuda())
            for scale in ms:
                if scale != 1:
                    // bicubic is only  available in pytorch> 1.1
                    input_img = nn.functional.interpolate(input_img, scale_factor=scale, mode="bicubic", align_corners=False)
                outputs = model(input_img) 
                ff += outputs
        // norm feature
        if opt.PCB:
            // feature size (n,2048,6)
            // 1. To treat every part equally, I calculate the norm for every 2048-dim part feature.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: layumi/Person_reID_baseline_pytorch
Commit Name: 6b672ac6a0c6bbc41f89d3e4bc528b937363e032
Time: 2019-06-02
Author: zdzheng12@gmail.com
File Name: test.py
Class Name:
Method Name: extract_feature


Project Name: pytorch/examples
Commit Name: 031392ff2cbb5703558d17a676a456521f754190
Time: 2016-12-15
Author: soumith@fb.com
File Name: mnist/main.py
Class Name:
Method Name: train