elsampsa / valkka-live

OpenSource Video Surveillance Program
GNU Affero General Public License v3.0
31 stars 12 forks source link

valkka-live doesn't launch properly #2

Closed wkelongws closed 5 years ago

wkelongws commented 5 years ago

I was trying valkka-live on my Ubuntu 16.04 machine with python 3.5. After I installed valkka-live following the instructions (https://elsampsa.github.io/valkka-live/_build/html/index.html), I got the follow message in terminal after executing the valkka-live binary:

valkka.mvision.__init__ : could not import module alpr : ''
valkka.mvision.__init__ : could not import module yolo3 : 'No module named 'darknet''
valkka.mvision.__init__ : could not import module yolo2 : 'No module named 'darknet''
valkka.mvision.__init__ : could not import module yolo3tiny : 'No module named 'darknet''
mvision scan: submodule valkka.mvision.tools missing MVisionProcess
mvision scan: submodule valkka.mvision.base missing MVisionProcess
mvision scan: found machine vision class with name, tag and max_instances
mvision scan: found machine vision class with name, tag and max_instances
mvision scan: submodule valkka.mvision.constant missing MVisionProcess
mvision scan: submodule valkka.mvision.multiprocess missing MVisionProcess
valkka.live : loading config file for version number
DeviceList :  clearSelection
QCheckBoxColumn: state_changed_slot : live_main
SlotFormSet :  showCurrent: current_row= None
QCheckBoxColumn: state_changed_slot : bind
MemoryConfigForm :  no row!
CPUScheme : cores 8
valkka.live : Using default mem config
CPUScheme : cores 8
GPUHandler: findXScreens: true screens: [<PySide2.QtGui.QScreen object at 0x7f781c0d95c8>]
gpuhandler : GPUHandler: starting OpenGLThread with :0.0
GLX_EXT_swap_control
OpenGLThread::setSwapInterval: could not set swap interval
OpenGLThread::setSwapInterval: could not set swap interval
gpuhandler : GPUHandler: OpenGLThread started

And this is a "Valkka Live" X window popped up with a blank/white window. Screenshot from 2019-04-29 09-27-23 What could be the issue? (It doesn't look like a python issue which was reported in the other ticket)

elsampsa commented 5 years ago

Hi,

Thanks for the report.

Here is the python issue you commented: https://github.com/elsampsa/valkka-live/issues/1

I do think its a python issue. As explained in that ticket, there is a devilish api change in the pkgutil python library, when going from Ubuntu 16 (python 3.5) to Ubuntu 18 (python 3.6).

We could try to find time for testing & debugging the program in python3.5, but I'm not sure if it's worth the effort, since Ubuntu 16 LTS is starting to be a bit obsolete linux distro.

eranpet commented 5 years ago

A comment: I have been able run valkka-live in python3.5 virtualenv using Ubuntu 18 (did it following our instructions: https://stackoverflow.com/questions/2812520/dealing-with-multiple-python-versions-and-pip/50319252#50319252 )

so maybe the python3.5 is not an issue here.

wkelongws commented 5 years ago

@elsampsa @eranpet Thanks for the quick reply. I don't think it is python version related and I don't see how the issue can be related to Ubuntu version as well since there are no error message thrown out... Does any of the terminal output look abnormal and worth an attention here? And actually based on my experience even though Ubuntu 18 has been out there for a long while but still quite large efforts (if not the majority) in the filed of AI, machine learning are spent under Ubuntu 16. And IMO Valkka is advantaged in integrating mvison stuff with streaming so to me maybe Ubuntu 16 is even more relevant than Ubuntu 18.

elsampsa commented 5 years ago

Good points.

The output you posted .. I can't see anything fishy there. Two questions:

eranpet commented 5 years ago

@elsampsa : you did not look at that outpt carefully enough : I'm not getting this : OpenGLThread::setSwapInterval: could not set swap interval

elsampsa commented 5 years ago

nah.. it's not that. But anyway ..

wkelongws commented 5 years ago

@elsampsa

Loading numerical python Numpy loaded ok Numpy loaded from /home/shuo/.local/lib/python3.5/site-packages/numpy/init.py Numpy version 1.16.3

Loading Valkka Valkka loaded ok Version 0.10.0 Core loaded from /usr/lib/python3/dist-packages/valkka/core/init.py

Testing Valkka classes Valkka classes ok

Checking Valkka python examples version: 0.10.0

Loading OpenCV OpenCV loaded ok Version 4.1.0 Loaded from /home/shuo/.local/lib/python3.5/site-packages/cv2/cv2.cpython-35m-x86_64-linux-gnu.so



* I am using nvidia card and vidia driver, here is the output from `nvidia-smi`:

![2](https://user-images.githubusercontent.com/14045078/56921663-338e5b80-6a7b-11e9-9c06-062cc4c4588c.png)
(display is connected to TITAN X)

* here is the output from glxgears:

![3](https://user-images.githubusercontent.com/14045078/56921723-633d6380-6a7b-11e9-897d-b75c80ad0d00.png)
elsampsa commented 5 years ago

@eranpet I have an idea how you can spend your 1.st May vacation day : install valkka on ubuntu 16 LTS (with nvidia) and try it. :)

elsampsa commented 5 years ago

Let's try one more thing.

What is your PySide2 (the python qt bindings) version?

It should be 5.11.1

You can see this by updating valkka-examples and running python3 quicktest.py again

wkelongws commented 5 years ago

It is 5.11.1. Same blank window and console message when running valkka-live I updated valkka and here is the quicktest.py output:

Loading numerical python
Numpy loaded ok
   Numpy loaded from /home/shuo/anaconda2/envs/valkka/lib/python3.7/site-packages/numpy/__init__.py
   Numpy version     1.16.3

Loading Valkka
Valkka loaded ok
   Version           0.11.0
   Core loaded from  /home/shuo/anaconda2/envs/valkka/lib/python3.7/site-packages/valkka/core/__init__.py

   Testing Valkka classes
   Valkka classes ok

Checking Valkka python examples
   version: 0.11.0

Loading OpenCV
OpenCV loaded ok
   Version       3.4.2
   Loaded from   /home/shuo/anaconda2/envs/valkka/lib/python3.7/site-packages/cv2.cpython-37m-x86_64-linux-gnu.so

Loading PySide2
   Version       5.11.1
   Loaded from   /home/shuo/.local/lib/python3.7/site-packages/PySide2/__init__.py

(I just like to use conda and keep python related stuff in virtual env)

elsampsa commented 5 years ago

Yet another idea ..

wkelongws commented 5 years ago

I did a fresh installation of Ubuntu 18.04 and then install valkka-live. It worked!

There is an issue initially related to the Xserver:

gpuhandler : GPUHandler: starting OpenGLThread with :0.0
Invalid MIT-MAGIC-COOKIE-1 keyOpenGLThtead: initGLX: cannot connect to X server :0.0

So I changed https://github.com/elsampsa/valkka-live/blob/master/valkka/live/gpuhandler.py#L54 to x_connection = ":1." + str(n_gpu) then it worked.

I have tested mvision with both ALPR and YOLO and both works well!

One small bug I found is the Camera List doesn't display the port correctly from the configuration. See screen captures below, the port 1935 is not included in the camera list, thus the link cannot be properly opened.

Screenshot from 2019-06-14 16-33-02

Screenshot from 2019-06-14 16-32-43

Thanks and I am closing this ticket now.