Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about fuction and parameter #152

Open
BelieferQAQ opened this issue Mar 11, 2022 · 3 comments
Open

question about fuction and parameter #152

BelieferQAQ opened this issue Mar 11, 2022 · 3 comments

Comments

@BelieferQAQ
Copy link

Excuse me? How to use this function,singletest( ) , Does this function detect a CT?in additon,What does this parameter about 'isfeat' mean?Thank you very much!

@wentaozhu
Copy link
Owner

Could you tell me more about and where you mentioned?

@BelieferQAQ
Copy link
Author

this function:
def singletest(data,net,config,splitfun,combinefun,n_per_run,margin = 64,isfeat=False):
z, h, w = data.size(2), data.size(3), data.size(4)
print(data.size())
data = splitfun(data,config['max_stride'],margin)
data = Variable(data.cuda(async = True), volatile = True,requires_grad=False)
splitlist = range(0,args.split+1,n_per_run)
outputlist = []
featurelist = []
for i in range(len(splitlist)-1):
if isfeat:
output,feature = net(data[splitlist[i]:splitlist[i+1]])
featurelist.append(feature)
else:
output = net(data[splitlist[i]:splitlist[i+1]])
output = output.data.cpu().numpy()
outputlist.append(output)

output = np.concatenate(outputlist,0)
output = combinefun(output, z / config['stride'], h / config['stride'], w / config['stride'])
if isfeat:
    feature = np.concatenate(featurelist,0).transpose([0,2,3,4,1])
    feature = combinefun(feature, z / config['stride'], h / config['stride'], w / config['stride'])
    return output,feature
else:
    return output

I dont know this parameter about 'isfeat' mean. and how to use this function?

@wentaozhu
Copy link
Owner

May I know which file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants