HackerShackOfficial / AI-Smart-Mirror

Smart Mirror with a smart AI 🤖
MIT License
537 stars 214 forks source link

Having an issue when running bot.py as well as vision.py #50

Closed mshain closed 7 years ago

mshain commented 7 years ago

I have built a magic mirror using the MagicMirror2 framework and have had no issues on a RaspberryPI

I am trying to build the MM2 using a MacMini. When the MM is started I get a blank black screen.

I have tested it through a browser with the localhost:8080 with a text message and that works. The main issue is I can't get the vision part working. The camera works with FaceTime for Mac and QuicCam from the App store. This is the following errors I receive when running the step by step process.

The MacMini is running 10.10.5 with 4GB of memory I have opencv3 running version 3.2.0 I have JRE 1.8

I have not modified any of the files other than the API keys in bot.py.

I am probably missing something really simple but can't seem to locate it. Please Help!!

Mike Shain

AI-Mac-Mini:MagicMirror myname$ npm start

magicmirror@2.1.1 start /Users/myname/MagicMirror sh run-start.sh

Starting MagicMirror: v2.1.1 Loading config ... Loading module helpers ... Initializing new module helper ... Module helper loaded: aiclient Initializing new module helper ... Module helper loaded: aiclientdebugger All module helpers loaded. Starting server on port 8080 ... Starting server op port 8080 ... Server started ... Connecting socket for: aiclient Starting node helper for: aiclient Connecting socket for: aiclientdebugger Starting node helper for: aiclientdebugger Sockets connected & modules started ... Launching application. <<<< VTVideoEncoderSelection >>>> VTSelectAndCreateVideoEncoderInstanceInternal: no video encoder found for 'avc1'

[20:47:22.929] VTSelectAndCreateVideoEncoderInstanceInternal signalled err=-12908 (err) (Video encoder not available) at /SourceCache/CoreMedia_frameworks/CoreMedia-1562.238/Sources/VideoToolbox/VTVideoEncoderSelection.c line 1245 [20:47:22.929] VTCompressionSessionCreate signalled err=-12908 (err) (Could not select and open encoder instance) at /SourceCache/CoreMedia_frameworks/CoreMedia-1562.238/Sources/VideoToolbox/VTCompressionSession.c line 946 helper received: INITIALIZE helper received: INITIALIZE

from virtual environment when trying to run bot.py

(hhsmartmirror) AI-Mac-Mini:AI-Smart-Mirror myname$ python bot.py

No Java runtime present, requesting install.

Traceback (most recent call last):

File "bot.py", line 12, in

from nlg import NLG

File "/Users/myname/MagicMirror/AI-Smart-Mirror/nlg.py", line 7, in

gateway = launch_py4j_server()

File "/Users/myname/MagicMirror/AI-Smart-Mirror/py4j_server/init.py", line 34, in launch_py4j_server

_port = int(_pid.stdout.readline())

ValueError: invalid literal for int() with base 10: ''

(hhsmartmirror) AI-Mac-Mini:AI-Smart-Mirror myname$

When trying to run vision.py

(hhsmartmirror) AI-Mac-Mini:AI-Smart-Mirror myname$ python vision.py Warning: OpenCV not installed. To use facial recognition, make sure you've properly configured OpenCV. Traceback (most recent call last): File "vision.py", line 51, in faceCascade = cv2.CascadeClassifier("models/facial_recognition_model.xml") NameError: name 'cv2' is not defined (hhsmartmirror) AI-Mac-Mini:AI-Smart-Mirror myname$