MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    MMM-Facial-Recognition-OCV3 cant run toold.capture.py

    Troubleshooting
    3
    5
    1700
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      idmarco last edited by

      Hi!

      I followed the steps for installation. I have not had any problems.
      However, when I run the tools.capture.py file I get the following error.

      RESTART: /home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/tools.capture.py
      Traceback (most recent call last):
      File “/home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/tools.capture.py”, line 9, in
      from lib.tools.capture import ToolsCapture
      File “/home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/lib/tools/capture.py”, line 19, in
      from config import ToolsConfig
      ImportError: No module named ‘config’

      Can you help me?

      1 Reply Last reply Reply Quote 1
      • S
        Sebi76 last edited by

        Hello ,

        i had the same Problem. Clean Install from here…
        " https://github.com/normyx/MMM-Facial-Recognition-OCV3 "

        pi@raspberrypi:~/MagicMirror/modules/MMM-Facial-Recognition-OCV3 $ sudo python3 tools.capture.py
        Traceback (most recent call last):
        File “tools.capture.py”, line 9, in
        from lib.tools.capture import ToolsCapture
        File “/home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/lib/tools/capture.py”, line 19, in
        from config import ToolsConfig
        ImportError: cannot import name ‘ToolsConfig’

        1 Reply Last reply Reply Quote 0
        • S
          Sebi76 last edited by

          I found the issue.

          Change in capture.py

          from config import ToolsConfig -> from .config import ToolsConfig

          S 1 Reply Last reply Reply Quote 1
          • S
            SdeGeata @Sebi76 last edited by

            @Sebi76 said in MMM-Facial-Recognition-OCV3 cant run toold.capture.py:

            from .config import ToolsConfig

            Well this solved the first of two problems for me. I have been getting the same error on capture since i installed. Thanks!

            Now however, i get this error when trying to train:

            OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in resize, file /home/pi/opencv/modules/imgproc/src/imgwarp.cpp, line 3483
            Traceback (most recent call last):
              File "tools.train.py", line 14, in <module>
                ToolsTrain().train()
              File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/lib/tools/train.py", line 53, in train
                faces.append(self.prepareImage(filename))
              File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/lib/tools/train.py", line 29, in prepareImage
                return self.face.resize(cv2.imread(filename, cv2.IMREAD_GRAYSCALE),ToolsConfig.FACE_WIDTH, ToolsConfig.FACE_HEIGHT)
              File "/home/pi/MagicMirror/modules/MMM-Facial-Recognition-OCV3/lib/common/face.py", line 113, in resize
                return cv2.resize(image, (face_width, face_height), interpolation=cv2.INTER_LANCZOS4)
            cv2.error: /home/pi/opencv/modules/imgproc/src/imgwarp.cpp:3483: error: (-215) ssize.width > 0 && ssize.height > 0 in function resize
            
            

            Any idea what that’s about???

            S 1 Reply Last reply Reply Quote 0
            • S
              SdeGeata @SdeGeata last edited by

              @SdeGeata

              Nevermind, I just fixed it! It was an outdated PIP that wasn’t getting updated without SUDO.

              sudo pip install future --upgrade
              
              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy