oukohou / ssr_net_pytorch Goto Github PK
View Code? Open in Web Editor NEWa Pytorch reimplementation of SSRNet.
a Pytorch reimplementation of SSRNet.
你好,你这个版本的迭代速度大概是什么样子的。之前训练的感觉数据处理比较慢~
Hi there,
The official version needs to preprocess the image dataset, but I can not find this part in your code. Doesn't your code need this process?
Regards,
Hi, I have some questions to consult:
我给这个项目写了一份onnxruntime c++版本的推理,在ort_ssrnet-cn.md .
我看你给的指标有对应年龄的3岁5岁误差准确度。对应的MegaAge_Asian上年龄平均误差MAE是多大呢?
Hi, oukohou!
Thanks for the pytorch version of SSR net.
I have ran the inference_image file for the prediction, pretty easy to use, and I have some questions.
in the inference_images.py file, line44, the code is
image_ = image_.cuda()
but actually I don't have a gpu, so there will be an error occurred. I think
image_ = image_.to(device)
is better in my opinion.
I have read your read.me file. If I didn't misunderstand you, the only one pretrained model was trained on IMDB and Mega datasets. However, in the train_SSR-net.py file, I saw
from datasets.read_face_age_data import FaceAgeDatasets
Now I'm confused. Did you use face age dataset for training? this one?
Or did you just use IMDB and Mega only?
And if possible, could you tell me which solution(datasets) has the best performance?
Looking forward to hear from you soon.
inference_images.py
中的方法inference_single_image
有如下代码:
image_ = cv2.imread(image_path_)
image_ = T.Compose([
T.ToPILImage(),
T.Resize((input_size_, input_size_)),
T.RandomHorizontalFlip(),
T.ToTensor(),
T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])])(image_)
opencv读取的图像通道顺序为BGR,而[0.485, 0.456, 0.406], [0.229, 0.224, 0.225]是Imagenet的均值和标准差,RGB通道顺序,transforms.ToPILImage() 只是单纯的将格式变为PIL,没有转换通道顺序的功能。此处写法是否有问题?
@oukohou 你好, 如果我想扩大模型输入尺寸,大概需要改那些东西?
不好意思,想请教一下模型输入是经过什么人脸检测啊,大概要裁剪到什么样子。
您好,请问您有用imdb wiki制作的数据集训练和测试嘛,我训练的效果很差,mae 只有8,+
I am running inference_images file on my sample image and it gives different results every time. I think the output should be same in eval mode every time. Am I missing something? I haven't done any kind of preprocessing on the image, but it is already aligned and cropped.
您好,如果我使用输入的不是图片,是3维矩阵(大脑的3维矩阵.mat)来做这样的年龄预测估计,您感觉如果使用您的方法和代码修改后可行吗?
C:\ProgramData\Anaconda3\python.exe D:/PycharmProjects/SSR_Net_Pytorch-master/train_SSR-Net.py
Traceback (most recent call last):
File "D:/PycharmProjects/SSR_Net_Pytorch-master/train_SSR-Net.py", line 214, in
num_epochs_=num_epochs,
File "D:/PycharmProjects/SSR_Net_Pytorch-master/train_SSR-Net.py", line 63, in train_model
for i, (inputs, labels) in enumerate(dataloaders_[phase]):
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 615, in next
batch = self.collate_fn([self.dataset[i] for i in indices])
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 615, in
batch = self.collate_fn([self.dataset[i] for i in indices])
File "D:\PycharmProjects\SSR_Net_Pytorch-master\datasets\read_imdb_data.py", line 35, in getitem
image_, image_path_ = self.read_images(index)
File "D:\PycharmProjects\SSR_Net_Pytorch-master\datasets\read_imdb_data.py", line 52, in read_images
filename = self.images_df.iloc[index_].Filename
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\generic.py", line 4372, in getattr
return object.getattribute(self, name)
AttributeError: 'Series' object has no attribute 'Filename'
read_imdb_data.py
34 def getitem(self, index):
35 image_, image_path_ = self.read_images(index)
if self.mode in ['train', ]:
label = self.images_df.iloc[index].age
else:
label = image_path_
if self.augment:
image_ = self.augmentor(image_)
image_ = T.Compose([
T.ToPILImage(),
# T.RandomResizedCrop(self.input_size),
# T.RandomHorizontalFlip(),
T.ToTensor(),
T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])])(image_)
return image_.float(), label
51def read_images(self, index_):
52 filename = self.images_df.iloc[index_].Filename
image_path_ = os.path.join(self.base_path, filename)
image = cv2.imread(image_path_)
return image, image_path_
您好,在读您的代码中的时候并没有看出来self.lambda_index 的作用,在原作者论文中也没有,能解释一下吗?
Hello, thanks for your work!I trained based on megaage and got the accuracy of CA5: 75%, but I found that for a certain age group, such as 5060, 6070 elderly people, 010, 1020 young people, the accuracy of this age group is not ideal. Is it because there are relatively few age data on both sides of the dataset?
I need to invest more datasets in my estimated age?
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.