diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..865cb3e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. macOS Catalina, Windows 10 1903, Ubuntu 19.10] + - Python Video Annotator Version [e.g. 3.306] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.gitmodules b/.gitmodules index ed580eb..b336d11 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "base/pythonvideoannotator-models"] path = base/pythonvideoannotator-models - url = https://github.com/video-annotator/pythonvideoannotator-models.git + url = https://github.com/shaliulab/pythonvideoannotator-models.git [submodule "base/pythonvideoannotator-models-gui"] path = base/pythonvideoannotator-models-gui - url = https://github.com/video-annotator/pythonvideoannotator-models-gui.git + url = https://github.com/shaliulab/pythonvideoannotator-models-gui.git [submodule "plugins/pythonvideoannotator-module-backgroundfinder"] path = plugins/pythonvideoannotator-module-backgroundfinder url = https://github.com/video-annotator/pythonvideoannotator-module-backgroundfinder.git @@ -15,7 +15,7 @@ url = https://github.com/video-annotator/mcv-gui.git [submodule "libraries/confapp"] path = libraries/confapp - url = https://github.com/UmSenhorQualquer/confapp.git + url = https://github.com/shaliulab/confapp.git [submodule "plugins/pythonvideoannotator-module-contoursimages"] path = plugins/pythonvideoannotator-module-contoursimages url = https://github.com/video-annotator/pythonvideoannotator-module-contoursimages.git @@ -39,7 +39,7 @@ url = https://github.com/video-annotator/pythonvideoannotator-module-motioncounter.git [submodule "plugins/pythonvideoannotator-module-patheditor"] path = plugins/pythonvideoannotator-module-patheditor - url = https://github.com/video-annotator/pythonvideoannotator-module-patheditor.git + url = https://github.com/shaliulab/pythonvideoannotator-module-patheditor.git [submodule "plugins/pythonvideoannotator-module-regionsfilter"] path = plugins/pythonvideoannotator-module-regionsfilter url = https://github.com/video-annotator/pythonvideoannotator-module-regionsfilter.git @@ -57,7 +57,7 @@ url = https://github.com/video-annotator/pythonvideoannotator-module-virtualobjectgenerator.git [submodule "libraries/pyforms-gui"] path = libraries/pyforms-gui - url = https://github.com/UmSenhorQualquer/pyforms-gui.git + url = https://github.com/shaliulab/pyforms-gui.git [submodule "libraries/geometry-designer"] path = libraries/geometry-designer url = https://github.com/video-annotator/geometry-designer.git @@ -69,5 +69,5 @@ url = https://github.com/video-annotator/pythonvideoannotator-module-deeplab.git [submodule "plugins/pythonvideoannotator-module-idtrackerai"] path = plugins/pythonvideoannotator-module-idtrackerai - url = https://github.com/video-annotator/pythonvideoannotator-module-idtrackerai.git + url = https://github.com/shaliulab/pythonvideoannotator-module-idtrackerai.git diff --git a/README.md b/README.md index ab11bf7..4468cf7 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,8 @@ How to install: pip install python-video-annotator ``` -If you are having issues (e.g., MacOS Catalina): +## Intel Mac installation +### MacOS Catalina 1. Start with a fresh Virtual Environment (highly recommended) on your preferred Python distribution with Python 3.6: * example with Anaconda in Anaconda Prompt @@ -62,6 +63,49 @@ If you are having issues (e.g., MacOS Catalina): pip install python-video-annotator ``` +### MacOS Mojave + +1. Start with a fresh Virtual Environment (highly recommended) on your preferred Python distribution with Python 3.8: + * example with Anaconda in Anaconda Prompt + + ```bash + conda create -n videoannotator python=3.8 + + ... + + conta activate videoannotator + ``` + +2. Install PyFormsGUI 5 first + + ```bash + pip install pyforms-gui==5 + ``` + +3. Downgrade PyQt5 and QScintilla: + + ```bash + pip install --upgrade qscintilla==2.11.4 pyqt5==5.14.1 pyqtwebengine==5.14.0 + ``` + +4. Install missing packages + + ```bash + pip install opencv-python-headless PyOpenGL_accelerate + ``` + +5. Install Python Video Annotator, ignoring dependencies (will be installed afterwards since it has a conflict with opencv version) + + ```bash + pip install python-video-annotator==3.306 --no-deps + ``` + +6. Install python-video-annotator dependencies except the one that created conflicts (older version of opencv-python) + + ```bash + pip install geometry-designer modular-computer-vision-api modular-computer-vision-api-gui pypi-xmlrpc python-video-annotator-models python-video-annotator-models-gui python-video-annotator-module-background-finder python-video-annotator-module-contours-images python-video-annotator-module-create-paths python-video-annotator-module-deeplab python-video-annotator-module-distances python-video-annotator-module-eventstats python-video-annotator-module-find-orientation python-video-annotator-module-import-export python-video-annotator-module-motion-counter python-video-annotator-module-path-editor python-video-annotator-module-path-map python-video-annotator-module-regions-filter python-video-annotator-module-smooth-paths python-video-annotator-module-timeline python-video-annotator-module-tracking python-video-annotator-module-virtual-object-generator scipy send2trash simplejson sklearn + ``` + How to run: 1. After the installation completes, you can start Python Video Annotator with: diff --git a/base/pythonvideoannotator-models b/base/pythonvideoannotator-models index 8d56ca0..0322571 160000 --- a/base/pythonvideoannotator-models +++ b/base/pythonvideoannotator-models @@ -1 +1 @@ -Subproject commit 8d56ca075432a880105086fd1950a35a3f0b4ad4 +Subproject commit 032257117e7d146bbc8d2319315f7fa5f456accd diff --git a/base/pythonvideoannotator-models-gui b/base/pythonvideoannotator-models-gui index 6e0d5b6..2d135bc 160000 --- a/base/pythonvideoannotator-models-gui +++ b/base/pythonvideoannotator-models-gui @@ -1 +1 @@ -Subproject commit 6e0d5b6acf0a96284e95ffd7a7255b91e4054ab6 +Subproject commit 2d135bcea7f460954a2615eb76c1301bcab20c06 diff --git a/base/pythonvideoannotator/pythonvideoannotator/__init__.py b/base/pythonvideoannotator/pythonvideoannotator/__init__.py index cb461bb..ba0cfce 100755 --- a/base/pythonvideoannotator/pythonvideoannotator/__init__.py +++ b/base/pythonvideoannotator/pythonvideoannotator/__init__.py @@ -1,7 +1,7 @@ # !/usr/bin/python3 # -*- coding: utf-8 -*- -__version__ = "3.306" +__version__ = "3.6.5" __author__ = ["Ricardo Ribeiro", "Carlos Mao de Ferro", "Hugo Cachitas"] __credits__ = ["Ricardo Ribeiro", "Carlos Mao de Ferro", "Hugo Cachitas"] __license__ = "Attribution-NonCommercial-ShareAlike 4.0 International" diff --git a/base/pythonvideoannotator/pythonvideoannotator/base_module/base_io.py b/base/pythonvideoannotator/pythonvideoannotator/base_module/base_io.py index cacf2d2..d9dc549 100644 --- a/base/pythonvideoannotator/pythonvideoannotator/base_module/base_io.py +++ b/base/pythonvideoannotator/pythonvideoannotator/base_module/base_io.py @@ -21,6 +21,8 @@ def load(self, data, project_path=None): try: self._project.load(data, project_path) except Exception as e: + print(e) + print(traceback.print_exc()) QMessageBox.critical(self, "Error", str(e)) def save_project(self, project_path=None): diff --git a/base/pythonvideoannotator/pythonvideoannotator/base_module/base_keys_events.py b/base/pythonvideoannotator/pythonvideoannotator/base_module/base_keys_events.py index 94f099a..16abb8e 100644 --- a/base/pythonvideoannotator/pythonvideoannotator/base_module/base_keys_events.py +++ b/base/pythonvideoannotator/pythonvideoannotator/base_module/base_keys_events.py @@ -1,5 +1,5 @@ import logging - +import warnings from AnyQt.QtGui import QKeySequence from AnyQt.QtCore import Qt from pythonvideoannotator_models_gui.models.video.objects.object2d.datasets.path import Path @@ -40,6 +40,7 @@ def keyReleaseEvent(self, event): key = QKeySequence( event.modifiers() | event.key()).toString().encode("ascii", "ignore").decode() logger.debug(key) + print(key) ###################################################################################### #### TIMELINE SHORTCUTS ############################################################## @@ -134,6 +135,12 @@ def keyReleaseEvent(self, event): logger.debug('Play or pause the video') self.player.toggle_playing() + + # PAUSE the video. + elif key == conf.SHORT_KEYS['Pause the video.']: + logger.debug('Pause the video') + self.player.stop() + # Jumps 1 frame backwards. elif key == conf.SHORT_KEYS['Jumps 1 frame backward.']: logger.debug('Jumps 1 frame backward.') @@ -189,3 +196,41 @@ def keyReleaseEvent(self, event): # Set player speed to 9x elif key == conf.SHORT_KEYS['Set player speed to 9x.']: self.player.set_speed_9x() + + # Set player speed to 10x + elif key == conf.SHORT_KEYS['Set player speed to 10x.']: + self.player.set_speed_10x() + + # Set player speed to 9x + elif key == conf.SHORT_KEYS['Set player speed to 20x.']: + self.player.set_speed_20x() + + # Set player speed to 9x + elif key == conf.SHORT_KEYS['Set player speed to 30x.']: + self.player.set_speed_30x() + + # Set player speed to 9x + elif key == conf.SHORT_KEYS['Set player speed to 40x.']: + self.player.set_speed_40x() + + # Set player speed to 9x + elif key == conf.SHORT_KEYS['Set player speed to 50x.']: + self.player.set_speed_50x() + + # Set player speed to 9x + elif key == conf.SHORT_KEYS['Set player speed to 60x.']: + self.player.set_speed_60x() + + # Set player speed to 9x + elif key == conf.SHORT_KEYS['Set player speed to 70x.']: + self.player.set_speed_70x() + + # Set player speed to 9x + elif key == conf.SHORT_KEYS['Set player speed to 80x.']: + self.player.set_speed_80x() + + elif key == conf.SHORT_KEYS['Set player speed to 90x.']: + self.player.set_speed_90x() + + else: + logger.debug(f"Key {key} is not recognized") \ No newline at end of file diff --git a/base/pythonvideoannotator/pythonvideoannotator/settings.py b/base/pythonvideoannotator/pythonvideoannotator/settings.py index 5c354c5..324e705 100644 --- a/base/pythonvideoannotator/pythonvideoannotator/settings.py +++ b/base/pythonvideoannotator/pythonvideoannotator/settings.py @@ -78,10 +78,11 @@ 'Select the first event.': 'Alt+Q', 'Select the last event.': 'Alt+D', 'Select the next event.': 'Alt+D', - 'Select the previous event.': 'Alt+A', + 'Select the previous event.': 'Unmapped', # PLAYER 'Play or pause the video.': 'Ctrl+P', + 'Pause the video.': 'Alt+P', 'Jumps 1 frame backward.': 'Ctrl+I', 'Jumps 1 frame forward.': 'Ctrl+O', 'Jumps 20 seconds backward.': 'Ctrl+K', @@ -95,6 +96,16 @@ 'Set player speed to 7x.': 'Ctrl+7', 'Set player speed to 8x.': 'Ctrl+8', 'Set player speed to 9x.': 'Ctrl+9', + 'Set player speed to 10x.': 'Alt+1', + 'Set player speed to 20x.': 'Alt+2', + 'Set player speed to 30x.': 'Alt+3', + 'Set player speed to 40x.': 'Alt+4', + 'Set player speed to 50x.': 'Alt+5', + 'Set player speed to 60x.': 'Alt+6', + 'Set player speed to 70x.': 'Alt+7', + 'Set player speed to 80x.': 'Alt+8', + 'Set player speed to 90x.': 'Alt+9', + # SPECIAL KEYS #'Go to the next event and then click the mark the point button.': 'Ctrl+I', @@ -103,4 +114,11 @@ } from AnyQt.QtWidgets import QColorDialog, QFileDialog -PYFORMS_COLORDIALOGS_OPTIONS = QColorDialog.ShowAlphaChannel \ No newline at end of file +PYFORMS_COLORDIALOGS_OPTIONS = QColorDialog.ShowAlphaChannel + +READ_FORMAT="opencv" +TRY_TO_LOAD_FROM_NO_GAPS=True +FRAMES_ARE_ZERO_INDEXED=False +EXTRA_FUNCTIONS=False +RADIUS_TO_SELECT_BLOB = 25 + diff --git a/base/pythonvideoannotator/pythonvideoannotator/userstats.py b/base/pythonvideoannotator/pythonvideoannotator/userstats.py index 521223a..58b34d8 100644 --- a/base/pythonvideoannotator/pythonvideoannotator/userstats.py +++ b/base/pythonvideoannotator/pythonvideoannotator/userstats.py @@ -21,7 +21,7 @@ def get_usage_track_conf(): modified = datetime.datetime.fromtimestamp(os.path.getmtime(filepath)) now = datetime.datetime.now() - if (now - modified).total_seconds() > conf.USERSTATS_TIMEOUT_DAYS*60*24: + if (now - modified).total_seconds() > conf.USERSTATS_TIMEOUT_DAYS*60*60*24: return 'ask later' with open(filepath, "r") as infile: diff --git a/base/pythonvideoannotator/release_steps.sh b/base/pythonvideoannotator/release_steps.sh new file mode 100644 index 0000000..8cfc1ca --- /dev/null +++ b/base/pythonvideoannotator/release_steps.sh @@ -0,0 +1,7 @@ +python3 -m pip install --upgrade pip +python3 -m pip install --upgrade build +python3 -m pip install --upgrade twine + +python3 -m build +python3 -m twine upload dist/* # this requires PyPI user and password + diff --git a/base/pythonvideoannotator/setup.py b/base/pythonvideoannotator/setup.py index 107bd6d..ca33f20 100644 --- a/base/pythonvideoannotator/setup.py +++ b/base/pythonvideoannotator/setup.py @@ -20,10 +20,11 @@ REQUIREMENTS = [ "geometry_designer==0.4.38", "modular-computer-vision-api-gui==0.3.31", - "pyforms-gui==4.904.152", + "pyforms-gui-shaliulab==4.905.157", "modular-computer-vision-api==0.3.29", - "python-video-annotator-models-gui==0.7.63", - "python-video-annotator-models==0.8.82", + "python-video-annotator-models-gui-shaliulab==0.9.0", + "python-video-annotator-models-shaliulab==0.9.0", + "python-video-annotator-module-idtrackerai-shaliulab==1.0.9", "python-video-annotator-module-timeline==0.6.26", "python-video-annotator-module-eventstats==0.5.15", "python-video-annotator-module-virtual-object-generator==0.6.26", @@ -39,12 +40,12 @@ "python-video-annotator-module-import-export==0.5.23", "python-video-annotator-module-background-finder==0.5.21", "python-video-annotator-module-find-orientation==0.5.18", - "python-video-annotator-module-path-editor==0.5.28" + "python-video-annotator-module-path-editor-shaliulab==0.5.31" ] # REQUIREMENTS END setup( - name='Python video annotator', + name='Python video annotator-shaliulab', version=version, description="""""", author=['Ricardo Ribeiro'], diff --git a/libraries/pyforms-gui b/libraries/pyforms-gui index 5bb69b4..0d6b3c3 160000 --- a/libraries/pyforms-gui +++ b/libraries/pyforms-gui @@ -1 +1 @@ -Subproject commit 5bb69b4f9ec5695f507d5f9accc7884d6f0d3b82 +Subproject commit 0d6b3c3e00d021556c97a1aea5802027e83b59db diff --git a/plugins/pythonvideoannotator-module-idtrackerai b/plugins/pythonvideoannotator-module-idtrackerai index 8df27ec..338b40d 160000 --- a/plugins/pythonvideoannotator-module-idtrackerai +++ b/plugins/pythonvideoannotator-module-idtrackerai @@ -1 +1 @@ -Subproject commit 8df27ec1dbe093a3b1d9c051e4bf106832831759 +Subproject commit 338b40d8478c6674dcad364960bb6ee6c656fd67 diff --git a/plugins/pythonvideoannotator-module-patheditor b/plugins/pythonvideoannotator-module-patheditor index 31612ea..c8b9659 160000 --- a/plugins/pythonvideoannotator-module-patheditor +++ b/plugins/pythonvideoannotator-module-patheditor @@ -1 +1 @@ -Subproject commit 31612ea9620c2c247c22c55a93fb13f8a0834691 +Subproject commit c8b9659df378ecd6c9a509e4c5052ed020aa8342