nbansal90 / facial_attribute_segmentation Goto Github PK
View Code? Open in Web Editor NEWImplemeting Improving Facial Attribute Prediction using Semantic Segmentation using Pytorch
Implemeting Improving Facial Attribute Prediction using Semantic Segmentation using Pytorch
Hi,
Thank you for your work! I want to see the result on my own picture.Can you provide the pretrained model to have a look ?
Thanks.
Hi,
I am trying to use your code for face part parsing on the helen dataset, the training process was fine, but during validation, the output are all black images, I suspect the weight becomes zero for validation, any suggestion on how to solve this problem?
Below is the modified code snippet for training and validation.
for epoch in range(args.start_epoch, args.epochs):
#train(train_loader, model, criterion, optimizer,epoch)
#result = validate(val_loader, model, criterion, epoch)
# training
training_top1 = AverageMeter()
training_losses = AverageMeter()
training_batch_time = AverageMeter()
model.train()
end = time.time()
for i, (name, input_img, target) in enumerate(train_loader):
target = target.cuda(async=True)
input_img = input_img.float().cuda()
input_var = torch.autograd.Variable(input_img)
target_var = torch.autograd.Variable(target)
output = model(input_var)
#output = output.permute(0,2,3,1)
#output = torch.max(output,dim=3)[0]
loss = criterion(output, target_var)
prec1 = accuracy(output.data, target, topk=(1,))[0]
training_losses.update(loss.item(), input_img.size(0))
training_top1.update(prec1.item(), input_img.size(0))
optimizer.zero_grad()
loss.backward()
optimizer.step()
training_batch_time.update(time.time() - end)
end = time.time()
print('Epoch: [{0}][{1}/{2}]\t'
'Time {training_batch_time.val:.3f} ({training_batch_time.avg:.3f})\t'
'Loss {training_losses.val:.4f} ({training_losses.avg:.4f})\t'
'Prec@1 {training_top1.val:.3f} ({training_top1.avg:.3f})'.format(
epoch, i, len(train_loader), training_batch_time=training_batch_time,
training_losses=training_losses, training_top1=training_top1))
# evaluation
eval_top1 = AverageMeter()
eval_losses = AverageMeter()
model.eval()
with torch.no_grad():
for i, (name, input_img, target) in enumerate(val_loader):
target = target.cuda(async=True)
input_img = input_img.float().cuda()
input_var = torch.autograd.Variable(input_img)
target_var = torch.autograd.Variable(target)
output = model(input_var)
loss = criterion(output, target_var)
prec1 = accuracy(output.data, target, topk=(1,))[0]
eval_losses.update(loss.item(), input_img.size(0))
eval_top1.update(prec1.item(), input_img.size(0))
Thank you.
in paper:
2017-CVPR-SSP-Improving Facial Attribute Prediction using Semantic Segmentation
the balance acc = 1/2 (tp/NP + tn / Nn)
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.