hrnet / hrnet-image-classification Goto Github PK
View Code? Open in Web Editor NEWTrain the HRNet model on ImageNet
Home Page: https://jingdongwang2017.github.io/Projects/HRNet/
License: MIT License
Train the HRNet model on ImageNet
Home Page: https://jingdongwang2017.github.io/Projects/HRNet/
License: MIT License
To get the validation metrics,what imagenet should I use? Is it ILSVRC2012 or ILSVRC 2017?
hello,How is this new checkpoint used, and does it require a new yaml?
I have been trying to find the format in which I can train RPC Dataset with the HR-Net and do evaluation. It is COCO format. I am unable to use it in Tensor or Pytorch version of the code. The only support that is given is for Imagenet and that too doesnt help.
HI! from ~\lib\datasets\cityscapes.py
i can see:
self.class_weights = torch.FloatTensor([0.8373, 0.918, 0.866, 1.0345,
1.0166, 0.9969, 0.9754, 1.0489,
0.8786, 1.0023, 0.9539, 0.9843,
1.1116, 0.9037, 1.0865, 1.0955,
1.0865, 1.1529, 1.0507]).cuda()
What do you mean?
How to use tensortboard or wandb to visual trainning process same using in yolov5
The num_inchannels can't be found at config.py and other python-files
I try with "HRNet-Image-Classification/lib/core/function
.py" in this file, at line no. 104,
for i, (input, target) in enumerate(val_loader):
output = model(input)
batch_time.update(time.time() - end)
target = target.cuda(non_blocking=True)
loss = criterion(output, target)
in this I try with target variable, it shows correct values at train time, but at test time it shows the class label for image in which its stored. not accurate values. can anyone tell how to get class label values for "test.py" ? target variable shows inaccurate values at testing.
hi! if i want to modify the inputsize of HRNet-samll-v1 from 224 to 84, Which parameters of the network need to be modified? can u give me some advice? thanks!
Why do I use your HRNetW18, the forward time is 2.5 times as long as resnet50
Hi, authors! I'm wondering about the differences between HRNet-W18-C-Small-v1 and HRNet-W18-C-Small-v2. I'd appreciate it if you could point them out!
Hello. I am a beginner in deep learning and pytorch, and I have a question about how to use HRNet.
I downloaded the pre-trained model you provided (HRNet-W64-C) from one-drive and cloned the HRNet repo and opened it in pycharm.
In this state, I would like to test the image using the model I downloaded.
If you have a detailed explanation on how to do this, I would like to ask you a link, if not, for beginners.
Is it possible to redistribute your pretrained models ? Credit will be given to you of course.
Thanks!
Thanks writing codes.
If I want to directly use the function (get_cls_net) .
How can I define the parameters of config? It is not easy for me to assign variable config to HighResolutionNet.
In cls_hrnet_w18_small_v2_sgd_lr5e-2_wd1e-4_bs32_x100.yaml STAGE1 configuration should read NUM_BRANCHES instead of NUM_RANCHES. In fact this doesn't affect in anything the code since .make_stage instead called for stage1; however, just to be consistent it be good to change it.
when will you release the pretrain models? the onedrive links are all broken?
or can you release the download links in google drive or BaiduYun? thanks
The defualt.py in config folder is writed to describe pose_hrnet , I want to know that is it suited to image classification.
Thank you for this excellent work!
If there's any experiments supporting any conclusion of above question, please let us know :)
I have tried to convert this model to TorchScript using torch.jit.script. However, I am getting this issue:
RuntimeError:
Expected integer literal for index:
File "/home/david/Documents/pry/models/archs/hrnet.py", line 228
for i in range(self.num_branches):
x[i] = self.branches[i](x[i])
~~~~~~~~~~~~~~~ <--- HERE
x_fuse = []
No module named 'utils.modelsummary'?
For I don't have multi-GPUS, I changed the GPUS = (0,0,0,0), but this error came RuntimeError: inputs must be on unique devices.
There is no doubt telling that this network working on more than one GPUS. So how do I change the code to run them on single GPU?
Compared with different.model, could you report training time, and hardware?
when i was trying to recurrence the face-xray, I modified the HRNet-Image-Calssification, but I got a bug that loss is nan.
this is what i added after stage4 in the cls_hrnet.py
:
# Upsampling
x0_h, x0_w = y_list[0].size(2), y_list[0].size(3)
x1 = F.interpolate(y_list[1], size=(x0_h, x0_w), mode='bilinear',align_corners=True)
x2 = F.interpolate(y_list[2], size=(x0_h, x0_w), mode='bilinear',align_corners=True)
x3 = F.interpolate(y_list[3], size=(x0_h, x0_w), mode='bilinear',align_corners=True)
x = torch.cat([y_list[0], x1, x2, x3], 1)
x = self.one_conv2d(x) # one conv2d to make the channel to 1
x = F.interpolate(x, size=(224,224),mode='bilinear',align_corners=True)
xray = torch.sigmoid(x)
then I found the xray is almost zero and the loss is nan, what's wrong?
I write the loss function below:
def criterion(pred,target):
x = torch.add(torch.mul(target,torch.log(pred)),torch.mul(torch.sub(1,target),torch.log(torch.sub(1,pred))))
loss = -torch.mean(x)
return loss
I modify the network structure and train from scratch.Can I get your training log and compare it?
As I was reading throught the code, I found there's a lot of confusion and unnecessary complication. Can you please simplify?
Hello. Thank you for offering newly added checkpoints! When I tried to use the one "HRNet-W48-C (w/ CosineLR + CutMix + 300epochs)", my pytorch model loader and tar extractor couldn't work. Could you please release another version, or tell me the correct way to use it? Thanks!
Hi
Thanks for sharing your work, Could you please give guidance to convert this model to train a multi label classification, ie; Single image multiple outputs
Thanks in advance
Could you please provide the HRNet-W64-C
config file?
Do you have plan to have tensorflow support in hrnet? Or, is there any tensorflow implementation existing somewhere?
Thanks for such a great work.
I trained HRNet-W32-C in imagenet, got the pretrained cls model (final_state.pth.tar) which has 1956 keys.
However, the pretrained model (hrnet_w32-36af842e.pth) provided by pose_hrnet_w32 [https://github.com/leoxiaobin/deep-high-resolution-net.pytorch] has 2000 keys.
I compared the keys of them, the classification pretraining lacks some keys, what should I do? Looking forward to your reply.
I’ve been able to train my model, and perform validation, however, I cannot find a way to do inference. Even in validation, while it tells me the percentage it got wrong, I could not find any file or log that tells me which ones it got wrong. I’ve searched through the entire repo, and haven’t found a way to perform inference.
With that, I would like to ask the obvious question of how to perform inference and use the model.
https://github.com/HRNet/HRNet-Image-Classification/blob/8f158719e821836e21e6cba99a3241a12a13bc41/lib/models/cls_hrnet.py#L459~L473
If different block types are used in different stages, instead of the default bottleneck-basic-basic-basic in the original yaml file, the channel mismatch error as shown in the figure below will appear. To avoid this error, we change it in the transition layer and use conv3*3 between different stages to match the number of channels. The corrected code and results are shown in the figure below.
(The demonstration is only a proof of feasibility, not an actual demonstration of the code)
(the other repositories seem to have v2?).
I am interested in the following models:
HRNETV2_W18: "./pretrained_models/hrnetv2_w18_imagenet_pretrained.pth"
HRNETV2_W32: "./pretrained_models/hrnetv2_w32_imagenet_pretrained.pth"
HRNETV2_W48: "./pretrained_models/hrnetv2_w48_imagenet_pretrained.pth"
I am not able to download them from baidu. I wonder if someone can help to put them in google drive.
Many thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.