MakeHuman をWindows のパソコン環境でソースファイルから Python で動かす

MakeHuman is an open source application that allows users to create and customize 3D characters.

サイトが重く Windows のプログラムがダウンロードできなかったので Python で動かします

インストール

Git Large File Storage | Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise. (git-lfs.com)

git clone https://github.com/makehumancommunity/makehuman
cd makehuman
pip install -r requirements.txt
python .\makehuman\download_assets_git.py 

python .\makehuman\makehuman.py 

一部変更

.\makehuman\download_assets_git.py


sys.path.append(os.path.join(os.path.dirname(__file__), './lib'))

import getpath

バッチファイル

@echo off
::call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
call %~dp0\scripts\env_for_icons.bat  %*
SET PATH=%PATH%;%WINPYDIRBASE%\PortableGit;%WINPYDIRBASE%\PortableGit\bin
SET PATH=%PATH%;%WINPYDIRBASE%\ffmpeg\bin
If not exist %WINPYDIRBASE%\content mkdir  %WINPYDIRBASE%\content 

set APP_NAME=makehuman
set APP_DIR=%WINPYDIRBASE%\content\%APP_NAME%
echo %APP_DIR%
cd %WINPYDIRBASE%\content\

If not exist  %APP_DIR% git clone https://github.com/makehumancommunity/makehuman

cd %APP_DIR%
timeout /t 5
if not defined VENV_DIR (set "VENV_DIR=%APP_DIR%\venv")
if EXIST %VENV_DIR% goto :activate_venv

::python.exe -m venv "%VENV_DIR%" 
python.exe -m venv "%VENV_DIR%" --system-site-packages 
if %ERRORLEVEL% == 0 goto :pip
echo Unable to create venv 
goto :skip_venv

:pip
call "%VENV_DIR%\Scripts\activate"
pip install -r requirements.txt
python .\makehuman\download_assets_git.py 
cmd.exe /k

:activate_venv
call "%VENV_DIR%\Scripts\activate"
powershell -ExecutionPolicy  -command "$Obj = Start-Process  -FilePath timeout -argumentlist '/t 23' -PassThru ; Wait-Process -InputObject  $Obj  -Timeout 22 " > nul 2>&1
if %errorlevel% equ 0  "D:\WinPython\Spyder.exe" & cmd.exe /k 

If not exist %WINPYDIRBASE%\content\%APP_NAME%\makehuman goto :skip_cmd
echo on
python .\makehuman\makehuman.py 

goto :skip_venv
:skip_cmd
::
:skip_venv
cmd.exe /k

::set COMMANDLINE_ARGS=--skip-torch-cuda-test  --precision full --no-half --lowvram --disable-safe-unpickle
::python.exe webui.py
::call setup.bat 
timeout /t 55
::pip install tensorboardX
::pip install -r requirements.txt
cmd.exe /k


::pip install gradio==3.50
Running on local URL:  http://127.0.0.1:7860

Python

Posted by eightban