Git Product home page Git Product logo

Comments (5)

ollietb avatar ollietb commented on August 19, 2024 1

It's OK I managed to get it working using the dlib fork which was much easier to set up

from face_morpher.

alyssaq avatar alyssaq commented on August 19, 2024 1

Yeh, the problem is stasm not finding the openCV lib folder - its looking at /usr/local/lib. I dont have access to any Windows machine so not sure how to test/fix it. It might be easier to use the dlib branch: https://github.com/alyssaq/face_morpher/tree/dlib and follow the requirements section in the readme.

My plan is to eventually switch stasm to dlib.

from face_morpher.

alyssaq avatar alyssaq commented on August 19, 2024

Hi @ollietb stasm expects opencv3 to be installed. This article might help: https://www.learnopencv.com/install-opencv3-on-windows.
Stasm only needs the C++ opencv3 libraries.

A good test to see if opencv3 has been installed successfully is to run one of their examples:
https://docs.opencv.org/3.4.2/dc/d88/Drawing_1_8cpp-example.html
On mac, compiling it would be: g++ test.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui

from face_morpher.

oneandonlyoddo avatar oneandonlyoddo commented on August 19, 2024

Hey I got the same problem trying to run this in a Anaconda environment. I followed all steps in https://www.learnopencv.com/install-opencv3-on-windows. I can compile the test app they mention (C++ RedEyeRemover), run the python equivalent of it and import cv2 in a python session without any errors. Still I fail to install stasm because of the same error that @ollietb had.

(facemorph) C:\Users\Jonas\Workspace\python\facemorph>python
Python 3.7.2 (default, Jan  2 2019, 17:07:39) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.4.5'
>>>

Where is stasm looking for these files? It is definitely in the PATH.

from face_morpher.

jankaWIS avatar jankaWIS commented on August 19, 2024

I'm suffering with the same, related issue? alyssaq/stasm#4

Btw, https://pypi.org/project/facemorpher/ still points to stasm, probably would be good to put a link or a note there to use dlib instead. The problem then is that pip install facemorpher still uses spasm and yields:

ERROR: Command errored out with exit status 1:
   command: 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"'; __file__='"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\JANKA~1.WIS\AppData\Local\Temp\pip-wheel-jf_x9y6x'
       cwd: C:\Users\JANKA~1.WIS\AppData\Local\Temp\pip-install-rbm_w60m\stasm_f40e238c30a04ed0a617b93678af83d7\
  Complete output (32 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.7
  creating build\lib.win-amd64-3.7\stasm
  copying stasm\__init__.py -> build\lib.win-amd64-3.7\stasm
  running egg_info
  writing stasm.egg-info\PKG-INFO
  writing dependency_links to stasm.egg-info\dependency_links.txt
  writing requirements to stasm.egg-info\requires.txt
  writing top-level names to stasm.egg-info\top_level.txt
  reading manifest file 'stasm.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'stasm.egg-info\SOURCES.txt'
  creating build\lib.win-amd64-3.7\stasm\data
  copying stasm\data\README.txt -> build\lib.win-amd64-3.7\stasm\data
  copying stasm\data\haarcascade_frontalface_alt2.xml -> build\lib.win-amd64-3.7\stasm\data
  copying stasm\data\haarcascade_mcs_lefteye.xml -> build\lib.win-amd64-3.7\stasm\data
  copying stasm\data\haarcascade_mcs_righteye.xml -> build\lib.win-amd64-3.7\stasm\data
  copying stasm\data\testface.jpg -> build\lib.win-amd64-3.7\stasm\data
  running build_ext
  building '_stasm' extension
  creating build\temp.win-amd64-3.7
  creating build\temp.win-amd64-3.7\Release
  creating build\temp.win-amd64-3.7\Release\src
  creating build\temp.win-amd64-3.7\Release\src\mod_1
  C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\Library\mingw-w64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -I/usr/local/include -I/usr/local/Cellar/opencv/3.4.1_5/include -I/usr/local/include/opencv4 -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\include -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\include -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\include -c src\asm.cpp -o build\temp.win-amd64-3.7\Release\src\asm.o -std=c++11
  In file included from src\asm.cpp:5:0:
  src\stasm.h:33:30: fatal error: opencv2/opencv.hpp: No such file or directory
  compilation terminated.
  error: command 'C:\\Users\\janka.WISMAIN\\AppData\\Local\\Continuum\\anaconda3\\Library\\mingw-w64\\bin\\gcc.exe' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for stasm
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"'; __file__='"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\JANKA~1.WIS\AppData\Local\Temp\pip-record-_de8sxwp\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\Include\stasm'
         cwd: C:\Users\JANKA~1.WIS\AppData\Local\Temp\pip-install-rbm_w60m\stasm_f40e238c30a04ed0a617b93678af83d7\
    Complete output (32 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    creating build\lib.win-amd64-3.7\stasm
    copying stasm\__init__.py -> build\lib.win-amd64-3.7\stasm
    running egg_info
    writing stasm.egg-info\PKG-INFO
    writing dependency_links to stasm.egg-info\dependency_links.txt
    writing requirements to stasm.egg-info\requires.txt
    writing top-level names to stasm.egg-info\top_level.txt
    reading manifest file 'stasm.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'stasm.egg-info\SOURCES.txt'
    creating build\lib.win-amd64-3.7\stasm\data
    copying stasm\data\README.txt -> build\lib.win-amd64-3.7\stasm\data
    copying stasm\data\haarcascade_frontalface_alt2.xml -> build\lib.win-amd64-3.7\stasm\data
    copying stasm\data\haarcascade_mcs_lefteye.xml -> build\lib.win-amd64-3.7\stasm\data
    copying stasm\data\haarcascade_mcs_righteye.xml -> build\lib.win-amd64-3.7\stasm\data
    copying stasm\data\testface.jpg -> build\lib.win-amd64-3.7\stasm\data
    running build_ext
    building '_stasm' extension
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    creating build\temp.win-amd64-3.7\Release\src
    creating build\temp.win-amd64-3.7\Release\src\mod_1
    C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\Library\mingw-w64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -I/usr/local/include -I/usr/local/Cellar/opencv/3.4.1_5/include -I/usr/local/include/opencv4 -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\include -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\include -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\include -c src\asm.cpp -o build\temp.win-amd64-3.7\Release\src\asm.o -std=c++11
    In file included from src\asm.cpp:5:0:
    src\stasm.h:33:30: fatal error: opencv2/opencv.hpp: No such file or directory
    compilation terminated.
    error: command 'C:\\Users\\janka.WISMAIN\\AppData\\Local\\Continuum\\anaconda3\\Library\\mingw-w64\\bin\\gcc.exe' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"'; __file__='"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\JANKA~1.WIS\AppData\Local\Temp\pip-record-_de8sxwp\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\Include\stasm' Check the logs for full command output.

from face_morpher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.