Giter Site home page Giter Site logo

dr's People

Contributors

xiaofeiwang2018 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dr's Issues

RandomCrop如何导入

您好,可以麻烦问一下这个怎么导入嘛?我搜不到这个库呀?
from transform.transforms_group import RandomCrop
我运行代码,一直在这个地方报错是怎么回事呢?
if self.transform is not None: # train
info = self.hr_transform(info)
报错如下
File "E:\MyUse\CVcode\DR-main\data_process.py", line 91, in getitem
info = self.hr_transform(info)
File "D:\Soft\Anaconda\envs\pytorchgpu_38\lib\site-packages\torchvision\transforms\transforms.py", line 60, in call
img = t(img)
File "D:\Soft\Anaconda\envs\pytorchgpu_38\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "D:\Soft\Anaconda\envs\pytorchgpu_38\lib\site-packages\torchvision\transforms\transforms.py", line 586, in forward
width, height = F._get_image_size(img)
File "D:\Soft\Anaconda\envs\pytorchgpu_38\lib\site-packages\torchvision\transforms\functional.py", line 67, in _get_image_size
return F_pil._get_image_size(img)
File "D:\Soft\Anaconda\envs\pytorchgpu_38\lib\site-packages\torchvision\transforms\functional_pil.py", line 26, in _get_image_size
raise TypeError("Unexpected type {}".format(type(img)))
TypeError: Unexpected type <class 'list'>

GMSV algorithm?

Can you share the code of the GMSV algorithm in the article, not in the conference paper?

Code Issue?

            extractor = ModelOutputs(cls_net)
            features, fc_output = extractor(cls_input)
            cam_all_sr = {'size256': [], 'size128': [], 'size64': [], 'size32': []}
            for batch in range(fc_output.shape[0]):
                device = fc_output[batch].device.index
                index = np.argmax(fc_output[batch].cpu().data.numpy())
                if index == 0:
                    one_hot = np.zeros((1, fc_output[batch].size()[-1]), dtype=np.float32)
                    one_hot[0][0] = 1
                if index > 0:
                    one_hot = np.ones((1, fc_output[batch].size()[-1]), dtype=np.float32)
                    one_hot[0][0] = 0
                if batch == 0:
                    one_hot_all = Variable(torch.from_numpy(one_hot).cuda(device), requires_grad=True)
                else:
                    one_hot_all = torch.cat((Variable(torch.from_numpy(one_hot).cuda(device), requires_grad=True), one_hot_all), 0)

if the index of batches is the same, there is no problem. But if they are different, it calculates the opposite loss between one_hot_all and fc_output.

Example:

fc_output one_hot_all
[[0.9, 0.1, 0.1, 0.1, 0.1] [[1, 0, 0, 0, 0]
[0.8, 0.2, 0.2, 0.3, 0.4]] [1, 0, 0, 0, 0]] There is no problem.

fc_output one_hot_all
[[0.2, 0.1, 0.1, 0.1, 0.8] [[0, 1, 1, 1, 1]
[0.3, 0.2, 0.7, 0.3, 0.4]] [0, 1, 1, 1, 1]] There is no problem.

fc_output one_hot_all
[[0.9, 0.1, 0.1, 0.1, 0.7] [[0, 1, 1, 1, 1]
[0.3, 0.2, 0.4, 0.9, 0.4]] [1, 0, 0, 0, 0]] There is problem here because of this line torch.cat((Variable(torch.from_numpy(one_hot).cuda(device), requires_grad=True), one_hot_all), 0).

should be one_hot_all = torch.cat((one_hot_all, Variable(torch.from_numpy(one_hot).cuda(device), requires_grad=True)), 0) ???

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.