Comments (3)
Hello,
This code base does not officially provide such function at this point.
Unfortunately, it seems unlikely to be easily implemented from this repository. 🤔
You may need to load and transform your own query image, and replace it with the query set provided in the dataloader.
For example, the code snippet from test.py
Lines 28 to 35 in b58ebc0
should be something like below:
for i, (data, labels) in enumerate(tqdm_gen, 1):
myquery = # read, transform, and load the image to the GPU here.
data = data.cuda()
data = torch.cat((data[:k], myquery), dim=0)
data = model(data)
data_shot, data_query = data[:k], data[k:]
model.module.mode = 'cca'
logits = model((data_shot.unsqueeze(0).repeat(args.num_gpu, 1, 1, 1, 1), data_query))
print(logits.argmax(dim=1)) # you can see the prediction out of 0 to N-1 here
In this case, you can see how your query image is predicted based on a various compositions of support set.
Please let me know if I understood your question incorrectly.
Have a great day! 😃
from renet.
I had tried to give the following input : myquery= 'name.jpg' taken from testset. Then I had tried to give an other input:
myquery=' path to name.jpg'. In both cases I had the same following error:
TypeError: expected Tensor as element 1 in argument 0, but got str
It seems that it doesn't recognize the input myquery.
Thanks
from renet.
have you solved the question? can you tell me how to visualize the result?
from renet.
Related Issues (11)
- Conv3d or Conv4d in SCR HOT 1
- Is there an easy way to save checkpoints for Colab user? HOT 1
- Could you please provide the code of RENet applied to Grad-cam? HOT 6
- Inductive or transductive? HOT 1
- A question HOT 2
- Paper results HOT 2
- About GAP baseline HOT 2
- About the Eq.(4) in the paper HOT 6
- the miniimagenet data set you shared can't be accessed HOT 2
- GAP baseline HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from renet.