dambo
(Shlomo)
August 22, 2019, 8:44am
1
Hello,
I have bumped into this repo:
It uses xtensor for the dataflow from numpy to a C++ tensor to a libtorch tensor:
/* ========================================================================= *
* *
* SMPL++ *
* Copyright (c) 2018, Chongyi Zheng. *
* All Rights reserved. *
* *
* ------------------------------------------------------------------------- *
* *
* This software implements a 3D human skinning model - SMPL: A Skinned *
* Multi-Person Linear Model with C++. *
* *
* For more detail, see the paper published by Max Planck Institute for *
* Intelligent Systems on SIGGRAPH ASIA 2015. *
* *
* We provide this software for research purposes only. *
* The original SMPL model is available at http://smpl.is.tue.mpg. *
* *
* ========================================================================= */
//=============================================================================
This file has been truncated. show original
// transformer
xt::xarray<int64_t> kinematicTree;
xt::from_json(m__model["kinematic_tree"], kinematicTree);
m__kinematicTree = torch::from_blob(kinematicTree.data(),
{2, JOINT_NUM}, torch::kInt64).to(m__device);// (2, 24)
2 Likes
Shisho_Sama
(A curious guy here!)
September 6, 2020, 12:17pm
2
This could be very helpful, but I wonder why he would need to use xtensor when he is already using libtorch. basically nearly all numpy functions are either directlty implemented in libtorch or can be easily implemented using existing functionalities.
I myself faced some conflicts couple of months ago when I tried to use both of them in a project and ultimately I gave up on xtensor and went full libtorch and I havent looked back.
What was the reason for not using xtensor?