nhshin-mcl / mwr Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Could you please also provide a demo python file? I would like to run the model on my own test images.
I try to train the regressor only with pretrained gol-weights encoder(freezed) on the same datasets, but it didn't converge to a desirable performance.
To my limited understanding, gol is a way to train the encoder to map the images to a certain feature embedding space where the features extracted from images of people of certain ages would follow those 3 constraints mentioned in gol paper. Therefore, it was supposed to work that use mwr stategy to replace the knn strategy in gol post-process.
Is it because my training procedure went wrong?Or should I try combine these model to train together?
Dear authors,
in your paper, you describe the regressor
However, in this repository, the regressor is implemented using convolutions with kernel size 1.
Lines 18 to 27 in d070db4
Line 48 in d070db4
Fully connected layers are usually implemented using a linear layer. Do you perform some slicing/viewing of the tensors, which makes the implementation equivalent to a linear layer? Or do you use convolutions here by mistake? Can you please elaborate on this?
Jakub
Is there any protocol with UTKface dataset's train valid spilt?
would you please share the preprocessing code for testing set so that we can verify the testing result reported in the paper?
I can't run the code without errors. Can you make it with notebook in Colab?
Would you please provide pipeline for visualization CLAP2015 dataset (maybe without code, just describing specific steps)? Am I need to use additional 7x7 avg pool after 5'th stage VGG16 for this? Does facial alignment have an impact here?
Hi, I read your paper and great work!
I have some issues running the models on my images. Given that you provide the model pretrained I expected to use them more or less in this manner
global_model = Network.Global_Regressor()
global_model.load_state_dict(torch.load('global.pth'))
local_models = []
for x in range(num_locals):
local_m = Network.Local_Regressor()
local_models.append(local_m.load_state_dict(torch.load(f'local{x}.pth')))
my_image = Image.open(open('face.jpg', 'rb'))
# Preprocess image
my_image = torch.transforms.ToTensor(my_image)
global_output = global_model(my_image)
if global_output == something:
age = local_models[3][my_image]
elif .... #other cases
But your code is super complicated and I don't understand it fully. In particular why the datasets are required if the models are pretrained? And why that's not always the case based on the "sampling" variable (I guess)?
So, basically, I just want to use your approach with the model pretrained on morph (or another dataset) to do inference on my data without ever having to download morph (or any other dataset). Is it possible? If not what do you mean with pretrained models?
Thanks
Lines 172 to 173 in d070db4
In L173 you have var name "test", but you use features['train']
here. Looks like a mistake. Am I wrong?
Thank you very much for your code's contribution to the field of ordinal regression. Your code is poetic.Could you please make public the Lower bounds and Upper bounds results you obtained in CLAP2015, and make public the Testing... [1/1436]
Iteration 1:
y1_age, y2_age, pred_mwr
Iteration 2:
y1_age, y2_age, pred_mwr
Because I don't know if the Lower bounds and Upper bounds I get with my own data set are correct, I get the following result:Testing... [1/1436]
Iteration 1:
y1_age: [33.2 31.2 38.2 47.2 44.5]
y2_age: [33.2 31.2 38.2 47.2 44.5]
pred_mwr: 38.85999999999999
Iteration 2:
y1_age: [33.2 31.2 38.2 47.2 44.5]
y2_age: [33.2 31.2 38.2 47.2 44.5]
pred_mwr: 38.85999999999999
First thanks for your great work. I have a question that how can you evaluate how good your model while training ? I mean that how did you the valid set to evaluate the training model?
@nhshin-mcl can you please indicate how to train the model on any of the 4 datasets?
Hi, how to fix this issue, I have train with utk dataset.
(base) test3@ai3:~/Documents/test/ai/ag/ag-v3$ python3.6 code/op.py --dataset utk --regression global --experiment_setting train --im_path /mnt/test3/age
Namespace(backbone='Global_Regressor', ckpt_dir='ckpt', data_path='datalist', dataset='utk', experiment_setting='train', experiment_title='global/utk/train', fold=0, gpu=0, im_path='/mnt/test3/age', regression='global', tau=0.2)
Global Regression
Age range partition: [[21, 28], [24, 33], [29, 40], [34, 49], [41, 60]]
cuda:0
Get Global_Regressor
ckpt/global/UTK/train/fold0/utk_train.pth
Traceback (most recent call last):
File "code/op.py", line 62, in <module>
global_regression(args, train_data, test_data, sampling=sampling, sample_rate=sample_rate)
File "/home/test3/Documents/test/ai/ag/ag-v3/code/Prediction.py", line 22, in global_regression
checkpoint = torch.load(initial_model, map_location=device)
File "/home/test3/.local/lib/python3.6/site-packages/torch/serialization.py", line 593, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/home/test3/.local/lib/python3.6/site-packages/torch/serialization.py", line 763, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
EOFError: Ran out of input
MWR/train_code/dataloaders/data_utils.py
Lines 83 to 84 in 200843d
Thanks for your excellent work. Is the training two-stage for global regressor and local regressor respectively?
First congratulate for your great work? I have my own dataset and I want to train with your model.
But I have a question about the initial estimation when training. In your paper you wrote that "in the feature space, we find the K NNs to
x among all training instances in terms of the Euclidean distances"
I don't know the feature space your made from the beginning before training model or you got from one batchsize when training ?
Hope you can answer this question for me?
I tried to run op.py with the next command:
python op.py --dataset utk --regression global --experiment_setting coral --im_path UTKFace
But I have a problem with inhomogeneous part of sequence.
The full error text:
File "/home/vid/hdd/projects/PycharmProjects/MWR2/code/op.py", line 62, in <module>
global_regression(args, train_data, test_data, sampling=sampling, sample_rate=sample_rate)
File "/home/vid/hdd/projects/PycharmProjects/MWR2/code/Prediction.py", line 99, in global_regression
refer_idx, refer_idx_pair = select_reference_global_regression(train_data, pair_idx, np.array(loss_total), limit=1)
File "/home/vid/hdd/projects/PycharmProjects/MWR2/code/Utils.py", line 98, in select_reference_global_regression
y_1_idx_tmp, y_2_idx_tmp = idx[row], np.array(pair_idx)[idx[0]][column]
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6582,) + inhomogeneous part.
How to fix it?
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.