MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

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

    Scheduled Pinned Locked Moved Troubleshooting
    5 Posts 3 Posters 2.5k Views 3 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy