Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with recipe 3.7 #13

Open
rossant opened this issue Nov 5, 2014 · 9 comments
Open

Problem with recipe 3.7 #13

rossant opened this issue Nov 5, 2014 · 9 comments

Comments

@rossant
Copy link
Contributor

rossant commented Nov 5, 2014

Posted by Anand Muglikar.

I used the ipython notebook shown below which uses your code as a base:

http://nbviewer.ipython.org/github/ipython-books/cookbook-code/blob/master/notebooks/chapter03_notebook/07_webcam_py3.ipynb

On running the code, webcam opens but no video is seen on Iceweasel browser (firefox based). On Chrome, webcam just starts and immediately shuts. I'm a newbie in Python and do not know javascript. Please guide.

Thanks in advance! :)

@rossant
Copy link
Contributor Author

rossant commented Nov 5, 2014

Which version of Python and IPython do you have? Any error messages? You can find error messages by pressing F12; this will open the Developer tools (at least on Chrome).

@rossant
Copy link
Contributor Author

rossant commented Nov 5, 2014

Thanks for the reply Cyrille! :)

anand@anandeb:$ python --version
Python 2.7.6 :: Anaconda 1.9.2 (64-bit)
anand@anandeb:
$ ipython --version
2.0.0

What exactly to look for in the developer tools?
I want to do something like this using your code, because that code of jsfeat is quite complex for me. Is it possible?

http://inspirit.github.io/jsfeat/sample_haar_face.html

@rossant
Copy link
Contributor Author

rossant commented Nov 5, 2014

Yes that's doable! Instead of applying an image filter Python-side, you can detect the face with something like OpenCV.

In the developer tools, look for potential errors in the "JavaScript console". Here is the doc for Chrome.

@flothesof
Copy link

Hi there,

I'm also trying to use recipe 3.7. In fact, I'm unable to get it to run. When I execute the last cell from the notebook that should display the constructed widget, nothing happens.

From the discussion above, I figured out that I needed to check the JS console, which I did. It turns out that the execution of the last cell throws a couple of errors. After battling a little bit more I found what seems to be the root cause for me:

Class CameraView not found in registry

So I figured that the code in the cell defining the CameraView is not working properly defining the CameraView. I tried to copy paste the code from the cell that defines CameraView directly into my JS console and got yet another error message:

TypeError: WidgetManager.register_widget_view is not a function

Could you please tell me what you think about this? I'd love to use your example and build upon it. Thanks!

@rossant
Copy link
Contributor Author

rossant commented Mar 20, 2015

Are you using IPython 3.0? If so, that's expected. The widget interface has changed between 2.0 and 3.0 and I haven't had the time to upgrade the examples yet (it's on my list)... You'll find more information at http://ipython.org/ipython-doc/3/whatsnew/version3_widget_migration.html

@flothesof
Copy link

Yes, that's exactly the case. In fact, I initially didn't use IPython 3.0 but then the notebook was not readable: it complained that the nbformat used was not the right one... So downgrading again to IPython 2.x and converting to an acceptable nbformat should do the job? Thanks for your quick reply!

@rossant
Copy link
Contributor Author

rossant commented Mar 20, 2015

Yeah I had to convert to the latest nbformat because the notebooks wouldn't work with IPython 3.0... but then the widgets are broken! Fortunately I think you should be able to open the notebooks if you install the very latest version of IPython 2.x: in principle they've backported the latest nbformat to the IPython 2.x branch. Let me know if it works (or not).

@rossant rossant added the bug label Mar 20, 2015
@flothesof
Copy link

I downgraded and now it works in Firefox, but not Safari. Thanks!

The JS code says something about being able to set it to play / pause. Should there be a button for this, or not really?

@rossant
Copy link
Contributor Author

rossant commented Mar 20, 2015

I think there should be Play/Pause buttons in Google Chrome, not sure about Firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants