Comments (10)
Can you give more details on what are you doing, how are you constructing the dataset?
Did you read comments in https://github.com/Relja/netvlad/blob/master/datasets/dbBase.m ? Briefly looking at your error, sounds like there are no positives, so are you sure that you have images that are within the predefined distance threshold (posDistThr) ?
To test if your dataset is working, I would not run training, but just first see if you can succesfully run testCoreRank with some dummy data like dbFeat=zeros(10, length(db.numImages)) and qFeat=zeros(10, length(db.qImages))
from netvlad.
what does UTM mean? and how to modify it if i want to use my data?
from netvlad.
https://en.m.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system
Create a mat file with the fields as described in
https://github.com/Relja/netvlad/blob/master/datasets/dbBase.m
You can load my mat files and see what they look like.
from netvlad.
I Create a mat file with the fields from the dbBase, and load the tokyoTM_train.mat and creative a mat that for our own database, and we change the localpath.
whichSet: 'train'
dbImageFns: {340×1 cell}
utmDb: [2×340 double]
dbTimeStamp: [1×340 double]
qImageFns: {340×1 cell}
utmQ: [2×340 double]
qTimeStamp: [1×340 double]
numImages: 340
numQueries: 340
posDistThr: 25
posDistSqThr: 625
nonTrivPosDistSqThr: 100
And the data above all is our own train.mat ,but I couldn't run it .
from netvlad.
So did you check my comment "Briefly looking at your error, sounds like there are no positives, so are you sure that you have images that are within the predefined distance threshold (posDistThr) ?"
Specifically, this line:
https://github.com/Relja/netvlad/blob/master/testCoreRank.m#L33
probably gives empty output?
Positives are defined as here:
https://github.com/Relja/netvlad/blob/master/datasets/dbBase.m#L121
i.e. database images that have a squared UTM distance from the query smaller than nonTrivPosDistSqThr but larger than 1 to eliminate trivial positives (i.e. if your query=database set, then retrieving the same image is trivially easy and would give you 100%, so I make the distance at least 1 to account for this)
from netvlad.
I couldn't run the dbFeat=zeros(10, length(db.numImages)) and qFeat=zeros(10, length(db.qImages))
in the testCoreRank. Because the code couldn't run the words after (the line 32-34 in testCoreRank.m)
qID= toTest(iTestSample);
potPosIDs= db.nontrivialPosQ(qID);
if isempty(potPosIDs), continue; end
the potPosIDs is always empty. Then we open the nontrivialPosQ , and it jump to the (the line 116-119 in dbBase.m)
function posIDs= nontrivialPosQ(db, iQuery)
[posIDs, dSq]= db.cp.getPosIDs(db.utmQ(:,iQuery));
posIDs= posIDs(dSq>1 & dSq<=db.nonTrivPosDistSqThr );
end
it also says the posIDs is empty.Then we open the getPosIDs , and it jump to the (the line 39-51 in closePosition.m)
function [posIDs, ds]= getPosIDs(cp, utm)
inds= cp.getInds( utm );
posIDs= cat(1, ...
cp.hashTab{ ...
max(inds(1)-1, 1) : min(inds(1)+1, cp.hashSz(1)), ...
max(inds(2)-1, 1) : min(inds(2)+1, cp.hashSz(2)) } ...
);
ds= sum( bsxfun(@minus, utm, cp.utm(:,posIDs)) .^ 2, 1 );
keep= ds <= cp.posDistSqThr;
posIDs= posIDs(keep);
ds= ds(keep);
end
and the hashTab is empty.
cp.hashTab{ ...
max(inds(1)-1, 1) : min(inds(1)+1, cp.hashSz(1)), ...
max(inds(2)-1, 1) : min(inds(2)+1, cp.hashSz(2)) } ...
);
So I don't konw how to calculate some variable just like the posDistThr . Could you please give me some advice or example?
P.S: I can't see the example after the "Specifically, this line:" in the last asking.
P.S: what the use for the testcorerank.m?
from netvlad.
Maybe you didn't see my edited comment (I accidentally submitted it after "Specifically, this line:", but then edited)
testCoreRank randomly samples triplets (query, all potential positives, negative) and checks if they are correctly ordered (best positive is closer to query than the negative is), which is what the triplet loss is trying to optimize. But skipping it wouldn't solve your problem as your main problem is that there are no potential positives for your training query.
The hashTab is empty because there are no positives (unless there is a bug but I would bet against it). So just check if for any training query you have potential positives, e.g. pick db.utmQ(:, 1) and measure the squared distance from it to all db.utmDb. Are there any database images that are closer than nonTrivPosDistSqThr? I would guess not (otherwise I have a bug). In fact probably all are further away than even posDistSqThr, which is larger.
So you need to fix your dataset or UTM coordinates or increase the nonTrivPosDistSqThr (but this is dangerous as if it is too large, then maybe what you include are not positives).
from netvlad.
what is the use of "[obj.pretrain.val.recall, obj.pretrain.val.rankloss]" in trainweakly.m line 190-194 ?
Does the database needs to be pretrain before the real training ?
If I abandon the trainweakly.m line 190-194 what will happen ?
from netvlad.
It evaluates the initial network you supply to the code - for me this was generally a pretrained network on ImageNet so that's why I called it 'pretrain', but it can also be a randomly initialized network or whatever you want.
The problem is that your dataset is not set up correctly. This shows up in the evaluation in lines 190-194. If you comment those lines, your code will fail later during training as you have no positives for any of your queries.
from netvlad.
Closing this due to inactivity
from netvlad.
Related Issues (20)
- the TokyoTM database HOT 2
- pitts30k datasets HOT 3
- pitts30k datasets HOT 1
- Dataset of NetVLAD HOT 1
- Applying to Indoor usage HOT 2
- about Pittsburgh 250k dataset HOT 1
- Link to download Pittsburgh 250k: available on request here showing invalid link HOT 11
- Converting MATLAB trained model .mat files (off the shelf and trained on Pittsburg 30k) in Pytorch HOT 1
- Pitts30k datasets HOT 1
- NetVLAD effectiveness in Gazebo Environments HOT 3
- Questions about Pitts250k dataset panoramic image splitting HOT 1
- How to run the Trained Network Matlab HOT 1
- using in real time application HOT 1
- About demo test HOT 4
- some problem of dem.m HOT 14
- What is the difference between these two NetVLAD programs? HOT 4
- Where can I get Pitts250k data? HOT 1
- Pitts30k Datasets! HOT 1
- About datasets HOT 1
- Is it possible to convert to ONNX format? 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 netvlad.