Coder Social home page Coder Social logo

Comments (7)

edenraf avatar edenraf commented on August 15, 2024 1

For anyone else looking into this, I have found a fix. The error message comes from a websocket that is already open. I assume google colabs is using the 8080 port for something else.
So, I went into interface.py to line 212 and changed the port to 1234.
Then change the port call print(eval_js("google.colab.kernel.proxyPort(1234)"))
Done

from 3d-ken-burns.

sniklaus avatar sniklaus commented on August 15, 2024

Thank you for the detailed documentation! I was able to replicate your findings and my best guess is that Colab's proxy is unable to handle the /get_live request since this request is actually a stream and does not terminate. Since I am not super familiar with Colab, I am afraid that I do not know how to persuade Colab's proxy to forward such request. If anyone has any suggestions then Doug and I would be grateful for any hints.

from 3d-ken-burns.

Roemer avatar Roemer commented on August 15, 2024

It actually seems to work you just have to wait quite long. One issue there is, is that the requests to update_from/to are unthrottled.
I added a jquery throttler (https://github.com/cowboy/jquery-throttle-debounce) and that makes it more responsive.
I also adjusted the interface to take a port as a parameter. If wanted, I can create a PR with those changes.

from 3d-ken-burns.

sniklaus avatar sniklaus commented on August 15, 2024

Thank you for looking into this and sharing your findings! It would be great if you could fork this project and commit your changes there. I would be happy to point the readme to your fork such that people interested in this setup can make use of your modifications.

from 3d-ken-burns.

Roemer avatar Roemer commented on August 15, 2024

So I did some more research. The live stream that should be there does not work. I think this is some kind of colab limitation. What I tried now is to add a toggle button to switch between the stream preview and a still image which is refreshed on every update call. It works actually fairly well and allows the use of colab to view a preview. Surely not as smooth as with the stream but definitely better than nothing. I will open a PR for it, you can close it if you don't want to merge any changes.

from 3d-ken-burns.

edenraf avatar edenraf commented on August 15, 2024

@Roemer would you be able to post a little more code so I could replicate the interface on my colab? I tried using the code you posted at the top but get the following error. Perhaps I need to modify the interface.py to expect the google colabs link instead of localhost? Any help greatly appreciated!

Traceback (most recent call last): File "interface.py", line 213, in <module> gevent.pywsgi.WSGIServer(listener=('0.0.0.0', 8080), application=objFlask).serve_forever() File "/usr/local/lib/python3.7/dist-packages/gevent/baseserver.py", line 398, in serve_forever self.start() File "/usr/local/lib/python3.7/dist-packages/gevent/baseserver.py", line 336, in start self.init_socket() File "/usr/local/lib/python3.7/dist-packages/gevent/pywsgi.py", line 1545, in init_socket StreamServer.init_socket(self) File "/usr/local/lib/python3.7/dist-packages/gevent/server.py", line 180, in init_socket self.socket = self.get_listener(self.address, self.backlog, self.family) File "/usr/local/lib/python3.7/dist-packages/gevent/server.py", line 192, in get_listener return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family) File "/usr/local/lib/python3.7/dist-packages/gevent/server.py", line 288, in _tcp_listener sock.bind(address) File "/usr/local/lib/python3.7/dist-packages/gevent/_socketcommon.py", line 563, in bind return self._sock.bind(address) OSError: [Errno 98] Address already in use: ('0.0.0.0', 8080)

from 3d-ken-burns.

sniklaus avatar sniklaus commented on August 15, 2024

Huge thanks for sharing this information! I am hence closing this issue for now. πŸ‘

from 3d-ken-burns.

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.