码迷,mamicode.com
首页 > 其他好文 > 详细

Interspecies Knowledge Transfer for Facial Keypoint Detection关键点检测 论文实现

时间:2018-08-11 21:55:00      阅读:292      评论:0      收藏:0      [点我收藏+]

标签:github   ^c   imp   ready   arping   print   make   images   inter   

Interspecies Knowledge Transfer for Facial Keypoint Detection关键点检测

技术分享图片?技术分享图片

Github地址:Interspecies Knowledge Transfer for Facial Keypoint Detection(迁移学习检测动物头部关键点)

基于torch进行论文中想法的实现

论文地址

1. Torch的安装部分

不得不说torch要比caffe好配置多了,emm , 祝愿你们可以一次性顺利配置好,话不多说开始了

Torch的github库https://github.com/torch/distro

git clone https://github.com/torch/distro.git ~/torch --recursive
# 国内git clone特别慢,建议参考前一篇博客https://www.cnblogs.com/pprp/p/9450512.html进行加速
# 假设在~/torch下进行配置,你也可以更改位置
cd ~/torch
# 安装依赖(如果失败了,记得查看有哪些失败了,然后手动重装)
bash install-deps
# 安装
./install.sh
source ~/.bashrc

uninstall 卸载

rm -rf ~/torch
./clean.sh

可以使用命令行中的Luarocks安装新软件包:

# run luarocks WITHOUT sudo
$ luarocks install image
$ luarocks list

安装完成后,您可以使用命令来运行火炬th

Th简介详细介绍

$ th
 
  ______             __   |  Torch7                                   
 /_  __/__  ________/ /   |  Scientific computing for Lua.         
  / / / _ \/ __/ __/ _ \  |                                           
 /_/  \___/_/  \__/_//_/  |  https://github.com/torch   
                          |  http://torch.ch            
              
th> torch.Tensor{1,2,3}
 1
 2
 3
[torch.DoubleTensor of dimension 3]

th>

要退出交互式会话,请键入^c两次 - 控制键以及c键,两次或键入os.exit()。一旦用户输入了完整的表达式,例如1 + 2,并且命中输入,交互式会话将评估表达式并显示其值。

要评估在源文件file.lua中编写的表达式,请编写 dofile "file.lua"

要以非交互方式在文件中运行代码,可以将其作为th命令的第一个参数::

$ th file.lua

有多种方法可以运行Lua代码并提供选项,类似于可用于perlruby程序的选项:

 $ th -h
Usage: th [options] [script.lua [arguments]]

Options:
  -l name            load library name
  -e statement       execute statement
  -h,--help          print this help
  -a,--async         preload async (libuv) and start async repl (BETA)
  -g,--globals       monitor global variables (print a warning on creation/access)
  -gg,--gglobals     monitor global variables (throw an error on creation/access)
  -x,--gfx           start gfx server and load gfx env
  -i,--interactive   enter the REPL after executing a script

2. 具体用法

Update

To update your already installed distro to the latest master branch of torch/distro simply run:

./update.sh

Cleaning

To remove all the temporary compilation files you can run:

./clean.sh

To remove the installation run:

# Warning: this will remove your current installation
rm -rf ./install

You may also want to remove the torch-activate entry from your shell start-up script (~/.bashrc or ~/.profile).

Test

You can test that all libraries are installed properly by running:

./test.sh

3. 继续配置animal_human_kp

1. 安装一些其他配置

Install Torch requirements:

luarocks install torchx
  • npy4th (You may need to checkout commit from 5-10-16)
git clone https://github.com/htwaijry/npy4th.git
cd npy4th
luarocks make

Install Python requirements if needed:

Install the Spatial Tranformer module provided:

cd stnbhwd-master
luarocks make

2. 数据集

cd ~/animal_human_kp
cd data
wget https://www.dropbox.com/s/9t770jhcjqo3mmg/release_data.zip
unzip *.zip

3.模型下载

cd ~/animal_human_kp
cd models
wget https://www.dropbox.com/s/44ocinlmx8mp8v2/release_models.zip
unzip *.zip

4. 开始数据的测试

cd ~/animal_human_kp
mkdir output
cd torch
th test.th -out_dir_images ../output/

打开output文件夹

#会出现一些结果文件
results.html
stats.txt
bar.pdf

5. 训练模型

开始训练整个模型:

cd torch
th train_full_model.th

训练翘曲网络:

th torch/train_warping_net.th

Interspecies Knowledge Transfer for Facial Keypoint Detection关键点检测 论文实现

标签:github   ^c   imp   ready   arping   print   make   images   inter   

原文地址:https://www.cnblogs.com/pprp/p/9460973.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!