Comments (8)
Hi. If I remember correctly (was a while ago) I used this model and then I made a script that re-normalizes the weights to fit the torchvision resnet input, and reorders the weights from BGR to RGB. I could probably find the script if you would have any use for it.
I ended up comparing the network with the output from MatConvNet VGG-m, and they were very similar.
from pytracking.
Thanks a lot~
The script would be useful for me. I really appreciate your help~
from pytracking.
@martin-danelljan Hi, may you share that transform script with me? I failed to re-normalizes the weights myself...
from pytracking.
Hey. Sorry for the delay. Here is the code that I used. You need to have this repo in your python path.
import os
import sys
import torch
import torchvision
import pretrainedmodels
env_path = os.path.join(os.path.dirname(__file__), '..')
if env_path not in sys.path:
sys.path.append(env_path)
def main():
resnet18 = torchvision.models.__dict__['resnet18'](pretrained=True)
vggm = pretrainedmodels.models.vggm()
resnet18.vggmconv1 = vggm.features[0]
# Convert to RGB
weight = resnet18.vggmconv1.weight.clone()
resnet18.vggmconv1.weight[:,0,:,:] = weight[:,2,:,:]
resnet18.vggmconv1.weight[:,2,:,:] = weight[:,0,:,:]
# Normalize
vgg_mean = torch.Tensor(vggm.mean[::-1])
torch_std = torch.Tensor([0.229, 0.224, 0.225]).view(1,-1,1,1)
resnet18.vggmconv1.weight[...] = resnet18.vggmconv1.weight * (torch_std*255)
torch.save(resnet18.state_dict(), '../features/pretrained/resnet18_vggmconv1.pth')
if __name__ == '__main__':
main()
from pytracking.
the model vggm is no longer aviable,could please send me one?
'vggm': {
'imagenet':
'url': 'http://data.lip6.fr/cadene/pretrainedmodels/vggm-786f2434.pth',
from pytracking.
should be
https://data.lip6.fr/cadene/pretrainedmodels/vggm-786f2434.pth
from pytracking.
model = VGGM(num_classes=1000)
checkpoint = torch.load('vggm-786f2434.pth')
for key in list(checkpoint.keys()):
if 'classifier.' in key:
checkpoint[key.replace('classifier.', 'classif.')] = checkpoint[key]
del checkpoint[key]
model.load_state_dict(checkpoint)
from pytracking.
model = VGGM(num_classes=1000)
checkpoint = torch.load('vggm-786f2434.pth')
for key in list(checkpoint.keys()):
if 'classifier.' in key:
checkpoint[key.replace('classifier.', 'classif.')] = checkpoint[key]
del checkpoint[key]
model.load_state_dict(checkpoint)
from pytracking.
Related Issues (20)
- Initialization of tracker in a different code.
- Model of TaMOs HOT 2
- about avist HOT 1
- how to deal with No module named 'prroi_pool' HOT 2
- How to use my training model(.pth.tar file) to track with custom datasets ? HOT 1
- Can tomp process multiple images at once as batches? HOT 2
- Error building extension '_prroi_pooling' HOT 3
- Tamos has many bugs HOT 3
- Update installation for windows
- No matching checkpoint file found HOT 1
- Support for LMDB Dataset HOT 1
- TensorRT Conversion of KeepTrack HOT 2
- RTS Tracker Prediction Score HOT 1
- Documentation? HOT 1
- About TaoBurst.json HOT 1
- tomp user warning
- TypeError: list indices must be integers or slices, not str HOT 1
- ModuleNotFoundError: No module named 'ltr.admin.local' HOT 1
- LaGOT Dataset (TaMOs tracker) HOT 1
- TaMOs and LaSOT dataset 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 pytracking.