{"id":18472945,"url":"https://github.com/physicsx/ui-example-for-python-ai-applications-with-qt","last_synced_at":"2025-05-12T18:56:52.151Z","repository":{"id":45840245,"uuid":"497323290","full_name":"PhysicsX/UI-Example-for-Python-AI-applications-with-Qt","owner":"PhysicsX","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-12T11:24:31.000Z","size":8076,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T19:18:39.917Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhysicsX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-28T13:18:03.000Z","updated_at":"2022-11-02T21:04:41.000Z","dependencies_parsed_at":"2024-12-25T10:37:57.337Z","dependency_job_id":null,"html_url":"https://github.com/PhysicsX/UI-Example-for-Python-AI-applications-with-Qt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhysicsX%2FUI-Example-for-Python-AI-applications-with-Qt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhysicsX%2FUI-Example-for-Python-AI-applications-with-Qt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhysicsX%2FUI-Example-for-Python-AI-applications-with-Qt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhysicsX%2FUI-Example-for-Python-AI-applications-with-Qt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhysicsX","download_url":"https://codeload.github.com/PhysicsX/UI-Example-for-Python-AI-applications-with-Qt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253805813,"owners_count":21967050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T10:23:08.298Z","updated_at":"2025-05-12T18:56:52.127Z","avatar_url":"https://github.com/PhysicsX.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Industrial User Interface Example for Python Visual AI Applications with Qt\r\n\r\nIn this repository you can find that the User Interface to manage hardware configurations and draw related objects with Qt and QML for Python AI visual applications.\r\n\r\nBlock Diagram:\r\n\r\n\u003cimg src=\"https://github.com/PhysicsX/UI-Example-for-Python-AI-applications-with-Qt/blob/master/BlockDiagram.png?raw=true\" width=\"250\"\u003e\r\n\r\nLooks like:\r\n\r\n![](https://github.com/PhysicsX/UI-Example-for-Python-AI-applications-with-Qt/blob/master/demo.gif)\r\n\r\n## Installation\r\n\r\nQt should be installed in the target. Reference Qt version is 5.15.0. \r\nTested with ubuntu 18 and 20.\r\n\r\nclone the repo\r\n\r\n```bash\r\ngit clone https://github.com/PhysicsX/UI-Example-for-Python-AI-applications-with-Qt.git\r\n```\r\n\r\nIf you do not want to build manually, just run.\r\n\r\n```bash\r\n$ sudo bash\r\n# cd scripts\r\n# bash buildQt.sh\r\n```\r\nThen skip manual build section.\r\nIf you want to build it manually, follow the steps:\r\n\r\n```bash\r\n$ sudo bash\r\n# apt update\r\n# apt upgrade -y\r\n```\r\nAfter upgrading, necessary graphics dependencies is installed to enable eglfs and opengl es.\r\n\r\nSome dependencies should be installed also:\r\n```bash\r\n# apt install '.*libxcb.*' libxrender-dev libxi-dev libfontconfig1-dev libudev-dev libgles2-mesa-dev libgl1-mesa-dev gcc git bison python gperf pkg-config make libclang-dev build-essential libssl-dev\r\n```\r\nThen first we simply install qtbase and other necessary modules:\r\n\r\n* qtbase-everywhere-src-5.15.0.tar.xz\r\n* qtdeclarative-everywhere-src-5.15.0.tar.xz\r\n* qtquickcontrols-everywhere-src-5.15.0.tar.xz\r\n* qtquickcontrols2-everywhere-src-5.15.0.tar.xz\r\n* qtmultimedia-everywhere-src-5.15.0.tar.xz\r\n* qtsvg-everywhere-src-5.15.0.tar.xz\r\n* qtvirtualkeyboard-everywhere-src-5.15.0.tar.xz\r\n\r\n\r\nThese all can be installed from Qt official website.\r\n```bash\r\n# wget https://download.qt.io/archive/qt/5.15/5.15.0/submodules/qtbase-everywhere-src-5.15.0.tar.xz https://download.qt.io/archive/qt/5.15/5.15.0/submodules/qtdeclarative-everywhere-src-5.15.0.tar.xz https://download.qt.io/archive/qt/5.15/5.15.0/submodules/qtquickcontrols-everywhere-src-5.15.0.tar.xz https://download.qt.io/archive/qt/5.15/5.15.0/submodules/qtquickcontrols2-everywhere-src-5.15.0.tar.xz https://download.qt.io/archive/qt/5.15/5.15.0/submodules/qtmultimedia-everywhere-src-5.15.0.tar.xz https://download.qt.io/archive/qt/5.15/5.15.0/submodules/qtsvg-everywhere-src-5.15.0.tar.xz https://download.qt.io/archive/qt/5.15/5.15.0/submodules/qtvirtualkeyboard-everywhere-src-5.15.0.tar.xz https://download.qt.io/archive/qt/5.15/5.15.0/submodules/qtgraphicaleffects-everywhere-src-5.15.0.tar.xz\r\n```\r\n\r\nAll modules should be built individually in an order.\r\nFor qtbase:\r\n```bash\r\n# tar xf qtbase-everywhere-src-5.15.0.tar.xz\r\n# cd qtbase-everywhere-src-5.15.0\r\n# ./configure -opengl es2 -opensource -confirm-license -force-debug-info -openssl-linked -nomake examples -nomake tests -v\r\n# make -j8\r\n# make install\r\n# export QT_SELECT=5\r\n```\r\n\r\nAfter this qmake will be in the /usr/local/Qt-5.15.0/bin/qmake. This path can be changed with -prefix command. Modules which are built with this qmake will be stay in the path.\r\n\r\nConfiguration parameters should be like this:\r\n\r\n```\r\nConfigure summary:\r\n\r\nBuild type: linux-g++ (arm64, CPU features: neon)\r\nCompiler: gcc 7.5.0\r\nConfiguration: compile_examples enable_new_dtags force_debug_info largefile neon precompile_header shared shared rpath release c++11 c++14 c++17 c++1z concurrent dbus reduce_exports stl\r\nBuild options:\r\n  Mode ................................... release (with debug info)\r\n  Optimize release build for size ........ no\r\n  Building shared libraries .............. yes\r\n  Using C standard ....................... C11\r\n  Using C++ standard ..................... C++17\r\n  Using ccache ........................... no\r\n  Using new DTAGS ........................ yes\r\n  Generating GDB index ................... no\r\n  Relocatable ............................ yes\r\n  Using precompiled headers .............. yes\r\n  Using LTCG ............................. no\r\n  Target compiler supports:\r\n    NEON ................................. yes\r\n  Build parts ............................ libs tools\r\nQt modules and options:\r\n  Qt Concurrent .......................... yes\r\n  Qt D-Bus ............................... yes\r\n  Qt D-Bus directly linked to libdbus .... no\r\n  Qt Gui ................................. yes\r\n  Qt Network ............................. yes\r\n  Qt Sql ................................. yes\r\n  Qt Testlib ............................. yes\r\n  Qt Widgets ............................. yes\r\n  Qt Xml ................................. yes\r\nSupport enabled for:\r\n  Using pkg-config ....................... yes\r\n  udev ................................... yes\r\n  Using system zlib ...................... yes\r\n  Zstandard support ...................... no\r\nQt Core:\r\n  DoubleConversion ....................... yes\r\n    Using system DoubleConversion ........ no\r\n  GLib ................................... yes\r\n  iconv .................................. no\r\n  ICU .................................... yes\r\n  Built-in copy of the MIME database ..... yes\r\n  Tracing backend ........................ \u003cnone\u003e\r\n  Logging backends:\r\n    journald ............................. no\r\n    syslog ............................... no\r\n    slog2 ................................ no\r\n  PCRE2 .................................. yes\r\n    Using system PCRE2 ................... no\r\nQt Network:\r\n  getifaddrs() ........................... yes\r\n  IPv6 ifname ............................ yes\r\n  libproxy ............................... no\r\n  Linux AF_NETLINK ....................... yes\r\n  OpenSSL ................................ yes\r\n    Qt directly linked to OpenSSL ........ yes\r\n  OpenSSL 1.1 ............................ yes\r\n  DTLS ................................... yes\r\n  OCSP-stapling .......................... yes\r\n  SCTP ................................... no\r\n  Use system proxies ..................... yes\r\n  GSSAPI ................................. no\r\nQt Gui:\r\n  Accessibility .......................... yes\r\n  FreeType ............................... yes\r\n    Using system FreeType ................ yes\r\n  HarfBuzz ............................... yes\r\n    Using system HarfBuzz ................ yes\r\n  Fontconfig ............................. yes\r\n  Image formats:\r\n    GIF .................................. yes\r\n    ICO .................................. yes\r\n    JPEG ................................. yes\r\n      Using system libjpeg ............... no\r\n    PNG .................................. yes\r\n      Using system libpng ................ yes\r\n  Text formats:\r\n    HtmlParser ........................... yes\r\n    CssParser ............................ yes\r\n    OdfWriter ............................ yes\r\n    MarkdownReader ....................... yes\r\n      Using system libmd4c ............... no\r\n    MarkdownWriter ....................... yes\r\n  EGL .................................... yes\r\n  OpenVG ................................. no\r\n  OpenGL:\r\n    Desktop OpenGL ....................... no\r\n    OpenGL ES 2.0 ........................ yes\r\n    OpenGL ES 3.0 ........................ yes\r\n    OpenGL ES 3.1 ........................ yes\r\n    OpenGL ES 3.2 ........................ yes\r\n  Vulkan ................................. no\r\n  Session Management ..................... yes\r\nFeatures used by QPA backends:\r\n  evdev .................................. yes\r\n  libinput ............................... no\r\n  INTEGRITY HID .......................... no\r\n  mtdev .................................. no\r\n  tslib .................................. no\r\n  xkbcommon .............................. no\r\n  X11 specific:\r\n    XLib ................................. yes\r\n    XCB Xlib ............................. yes\r\n    EGL on X11 ........................... yes\r\n    xkbcommon-x11 ........................ no\r\nQPA backends:\r\n  DirectFB ............................... no\r\n  EGLFS .................................. yes\r\n  EGLFS details:\r\n    EGLFS OpenWFD ........................ no\r\n    EGLFS i.Mx6 .......................... no\r\n    EGLFS i.Mx6 Wayland .................. no\r\n    EGLFS RCAR ........................... no\r\n    EGLFS EGLDevice ...................... yes\r\n    EGLFS GBM ............................ no\r\n    EGLFS VSP2 ........................... no\r\n    EGLFS Mali ........................... no\r\n    EGLFS Raspberry Pi ................... no\r\n    EGLFS X11 ............................ yes\r\n  LinuxFB ................................ yes\r\n  VNC .................................... yes\r\nQt Sql:\r\n  SQL item models ........................ yes\r\nQt Widgets:\r\n  GTK+ ................................... no\r\n  Styles ................................. Fusion Windows\r\nQt PrintSupport:\r\n  CUPS ................................... no\r\nQt Sql Drivers:\r\n  DB2 (IBM) .............................. no\r\n  InterBase .............................. no\r\n  MySql .................................. no\r\n  OCI (Oracle) ........................... no\r\n  ODBC ................................... no\r\n  PostgreSQL ............................. no\r\n  SQLite2 ................................ no\r\n  SQLite ................................. yes\r\n    Using system provided SQLite ......... no\r\n  TDS (Sybase) ........................... no\r\nQt Testlib:\r\n  Tester for item models ................. yes\r\n\r\nNote: Also available for Linux: linux-clang linux-icc\r\n\r\nNote: When linking against OpenSSL, you can override the default\r\nlibrary names through OPENSSL_LIBS.\r\nFor example:\r\n    OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked\r\n\r\nQt is now configured for building. Just run 'make'.\r\nOnce everything is built, you must run 'make install'.\r\nQt will be installed into '/usr/local/Qt-5.15.0'.\r\n\r\nPrior to reconfiguration, make sure you remove any leftovers from\r\nthe previous build.\r\n\r\n```\r\n\r\nNow we can install submodules.\r\nFor qtdeclarative:\r\n```bash\r\n# cd ..\r\n# tar xf qtdeclarative-everywhere-src-5.15.0.tar.xz\r\n# cd qtdeclarative-everywhere-src-5.15.0\r\n# /usr/local/QtEpilog/bin/qmake\r\n# make -j8\r\n# make install\r\n```\r\nFor qtquickcontrols:\r\n```bash\r\n# cd ..\r\n# tar xf qtquickcontrols-everywhere-src-5.15.0.tar.xz\r\n# cd qtquickcontrols-everywhere-src-5.15.0\r\n# /usr/local/Qt-5.15.0/bin/qmake\r\n# make -j8\r\n# make install\r\n```\r\nFor qtquickcontrols2:\r\n```bash\r\n# cd ..\r\n# tar xf qtquickcontrols2-everywhere-src-5.15.0.tar.xz\r\n# cd qtquickcontrols2-everywhere-src-5.15.0\r\n# /usr/local/Qt-5.15.0/bin/qmake\r\n# make -j8\r\n# make install\r\n```\r\nFor qtmultimedia:\r\n```bash\r\n# cd ..\r\n# tar xf qtmultimedia-everywhere-src-5.15.0.tar.xz\r\n# cd qtmultimedia-everywhere-src-5.15.0\r\n# /usr/local/Qt-5.15.0/bin/qmake\r\n# make -j8\r\n# make install\r\n```\r\nFor qtsvg: ( this one is needed for qtvirtualkeyboard)\r\n```bash\r\n# cd ..\r\n# tar xf qtsvg-everywhere-src-5.15.0.tar.xz\r\n# cd qtsvg-everywhere-src-5.15.0\r\n# /usr/local/Qt-5.15.0/bin/qmake\r\n# make -j8\r\n# make install\r\n```\r\nFor qtVirtualKeyboard:\r\n```bash\r\n# cd ..\r\n# tar xf qtvirtualkeyboard-everywhere-src-5.15.0.tar.xz\r\n# cd qtvirtualkeyboard-everywhere-src-5.15.0\r\n# /usr/local/Qt-5.15.0/bin/qmake\r\n# make -j8\r\n# make install\r\n```\r\nFor qtGraphicalEffects:\r\n```bash\r\n# cd ..\r\n# tar xf qtgraphicaleffects-everywhere-src-5.15.0.tar.xz\r\n# cd qtgraphicaleffects-everywhere-src-5.15.0\r\n# /usr/local/Qt-5.15.0/bin/qmake\r\n# make -j8\r\n# make install\r\n```\r\n\r\n## How to test the application\r\n\r\nExample is tested in jetson nano/nx.\r\nOpencv should be installed/compiled with gstreamer option enabled.\r\n\r\n![](https://www.uctronics.com/media/catalog/product/cache/5d1f08909b337dbf64263212361f58e9/i/m/imx219_ff_ir_nano_4.jpg)\r\n\r\nNow you are ready to run the app. Picamera should be connected. Be sure to type \"sudo bash\".\r\n```\r\n# cd scripts\r\n# bash run.sh\r\n```\r\n\r\nThen for the facedetection application:\r\n```bash\r\n# cd scripts\r\n# python3 faceDetectionShm.py\r\n```\r\n\r\n### Citation\r\n\r\nUlas Dikme (2021). *Industrial user interface software design for visual\r\npython AI applications using embedded linux based systems*. Journal of Applied and Physical Sciences, 7(1), 1-10. [10.20474/japs-7.1](https://doi.org/10.20474/japs-7.1)\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphysicsx%2Fui-example-for-python-ai-applications-with-qt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphysicsx%2Fui-example-for-python-ai-applications-with-qt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphysicsx%2Fui-example-for-python-ai-applications-with-qt/lists"}