Skip to content

Commit 8cdb471

Browse files
authored
Merge pull request #3806 from OpenShot/opencv
New OpenCV Effect Pre-Processing UI
2 parents 418b536 + f49cf7a commit 8cdb471

16 files changed

+1254
-14
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ doc/_build
77
build
88
dist
99
openshot_qt.egg-info
10+
11+
protobuf_data/

.gitlab-ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ windows-builder-x64:
8585
- if (-not (Test-Path "artifacts.zip")) { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot/-/jobs/artifacts/develop/download?job=windows-builder-x64" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" }
8686
- Expand-Archive -Path artifacts.zip -DestinationPath .
8787
- Copy-Item "$CI_PROJECT_DIR/build/install-x64/python/*" -Destination "$CI_PROJECT_DIR"
88-
- $env:Path = "$CI_PROJECT_DIR\build\install-x64\lib;$CI_PROJECT_DIR\build\install-x64\python;C:\msys64\mingw64\bin;C:\msys64\mingw64\lib;C:\msys64\mingw64\lib\python3.7\;C:\msys64\mingw64\lib\python3.7\site-packages\;C:\msys64\mingw64\lib\python3.7\site-packages\PyQt5;C:\msys64\usr\lib\cmake\UnitTest++;C:\msys64\usr;C:\msys64\usr\lib;" + $env:Path;
88+
- $env:Path = "$CI_PROJECT_DIR\build\install-x64\lib;$CI_PROJECT_DIR\build\install-x64\python;C:\msys64\mingw64\bin;C:\msys64\mingw64\lib;C:\msys64\mingw64\lib\python3.7\;C:\msys64\mingw64\lib\python3.7\site-packages\;C:\msys64\mingw64\lib\python3.7\site-packages\PyQt5;C:\msys64\usr\lib\cmake\UnitTest++;C:\msys64\usr;C:\msys64\usr\lib;C:\msys64\usr\local\x64\mingw\bin;C:\msys64\usr\local;" + $env:Path;
8989
- $env:PYTHONPATH = "$CI_PROJECT_DIR\build\install-x64\python;C:\msys64\usr\lib;C:\msys64\usr\lib\site-packages\;C:\msys64\mingw64\lib\python3.7\;C:\msys64\mingw64\lib\python3.7\site-packages\;C:\msys64\mingw64\lib\python3.7\site-packages\PyQt5;";
9090
- New-Item -path "build/install-x64/share/" -Name "$CI_PROJECT_NAME" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID`nCI_PIPELINE_ID:$env:CI_PIPELINE_ID" -ItemType file -force
9191
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
@@ -112,7 +112,7 @@ windows-builder-x86:
112112
- if (-not (Test-Path "artifacts.zip")) { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot/-/jobs/artifacts/develop/download?job=windows-builder-x86" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" }
113113
- Expand-Archive -Path artifacts.zip -DestinationPath .
114114
- Copy-Item "$CI_PROJECT_DIR/build/install-x86/python/*" -Destination "$CI_PROJECT_DIR"
115-
- $env:Path = "$CI_PROJECT_DIR\build\install-x86\lib;$CI_PROJECT_DIR\build\install-x86\python;C:\msys32\mingw32\bin;C:\msys32\mingw32\lib;C:\msys32\mingw32\lib\python3.7\;C:\msys32\mingw32\lib\python3.7\site-packages\;C:\msys32\mingw32\lib\python3.7\site-packages\PyQt5;C:\msys32\usr\lib\cmake\UnitTest++;C:\msys32\usr;C:\msys32\usr\lib;" + $env:Path;
115+
- $env:Path = "$CI_PROJECT_DIR\build\install-x86\lib;$CI_PROJECT_DIR\build\install-x86\python;C:\msys32\mingw32\bin;C:\msys32\mingw32\lib;C:\msys32\mingw32\lib\python3.7\;C:\msys32\mingw32\lib\python3.7\site-packages\;C:\msys32\mingw32\lib\python3.7\site-packages\PyQt5;C:\msys32\usr\lib\cmake\UnitTest++;C:\msys32\usr;C:\msys32\usr\lib;C:\msys32\usr\local\x64\mingw\bin;C:\msys32\usr\local;" + $env:Path;
116116
- $env:PYTHONPATH = "$CI_PROJECT_DIR\build\install-x86\python;C:\msys32\usr\lib;C:\msys32\usr\lib\site-packages\;C:\msys32\mingw32\lib\python3.7\;C:\msys32\mingw32\lib\python3.7\site-packages\;C:\msys32\mingw32\lib\python3.7\site-packages\PyQt5;";
117117
- New-Item -path "build/install-x86/share/" -Name "$CI_PROJECT_NAME" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID`nCI_PIPELINE_ID:$env:CI_PIPELINE_ID" -ItemType file -force
118118
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')

installer/fix_qt5_rpath.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def print_min_versions(PATH):
6262
# Use 2 different matches, due to different output from different libraries (depending on compiler)
6363
REGEX_SDK_MATCH = re.compile(r'.*(LC_VERSION_MIN_MACOSX).*version (\d+\.\d+).*sdk (\d+\.\d+).*(cmd)', re.DOTALL)
6464
REGEX_SDK_MATCH2 = re.compile(r'.*sdk\s(.*)\s*minos\s(.*)')
65+
6566
VERSIONS = {}
6667

6768
# Find files matching patterns
@@ -89,13 +90,13 @@ def print_min_versions(PATH):
8990
if min_version and sdk_version:
9091
print("... scanning %s for min version (min: %s, sdk: %s)" % (file_path.replace(PATH, ""),
9192
min_version, sdk_version))
92-
9393
# Organize by MIN version
9494
if min_version in VERSIONS:
9595
if file_path not in VERSIONS[min_version]:
9696
VERSIONS[min_version].append(file_path)
9797
else:
9898
VERSIONS[min_version] = [file_path]
99+
99100
if min_version in ['11.0']:
100101
print("ERROR!!!! Minimum OS X version not met for %s" % file_path)
101102

@@ -109,6 +110,7 @@ def print_min_versions(PATH):
109110
for key in sorted(VERSIONS.keys()):
110111
print("%s (%d)" % (key, len(VERSIONS[key])))
111112

113+
112114
if __name__ == "__main__":
113115
"""Run these methods manually for testing"""
114116
PATH = "/Users/jonathanthomas/apps/openshot-qt/build/exe.macosx-10.15-x86_64-3.7"

src/classes/effect_init.py

+187
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
"""
2+
@file
3+
@brief This file contains some Effect metadata related to pre-processing of Effects
4+
@author Jonathan Thomas <[email protected]>
5+
@author Frank Dana <ferdnyc AT gmail com>
6+
7+
@section LICENSE
8+
9+
Copyright (c) 2008-2018 OpenShot Studios, LLC
10+
(http://www.openshotstudios.com). This file is part of
11+
OpenShot Video Editor (http://www.openshot.org), an open-source project
12+
dedicated to delivering high quality video editing and animation solutions
13+
to the world.
14+
15+
OpenShot Video Editor is free software: you can redistribute it and/or modify
16+
it under the terms of the GNU General Public License as published by
17+
the Free Software Foundation, either version 3 of the License, or
18+
(at your option) any later version.
19+
20+
OpenShot Video Editor is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+
GNU General Public License for more details.
24+
25+
You should have received a copy of the GNU General Public License
26+
along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
27+
"""
28+
29+
# Not all Effects support pre-processing, so for now, this is a hard-coded
30+
# solution to providing the pre-processing params needed for these special effects.
31+
32+
effect_options = {
33+
# TODO: Remove Example example options
34+
"Example": [
35+
{
36+
"title": "Region",
37+
"setting": "region",
38+
"x": 0.05,
39+
"y": 0.05,
40+
"width": 0.25,
41+
"height": 0.25,
42+
"type": "rect"
43+
},
44+
{
45+
"max": 100,
46+
"title": "Volume",
47+
"min": 0,
48+
"setting": "volume",
49+
"value": 75,
50+
"type": "spinner"
51+
},
52+
{
53+
"value": "blender",
54+
"title": "Blender Command (path)",
55+
"type": "text",
56+
"setting": "blender_command"
57+
},
58+
{
59+
"max": 192000,
60+
"title": "Default Audio Sample Rate",
61+
"min": 22050,
62+
"setting": "default-samplerate",
63+
"value": 44100,
64+
"values": [
65+
{
66+
"value": 22050,
67+
"name": "22050"
68+
},
69+
{
70+
"value": 44100,
71+
"name": "44100"
72+
},
73+
{
74+
"value": 48000,
75+
"name": "48000"
76+
},
77+
{
78+
"value": 96000,
79+
"name": "96000"
80+
},
81+
{
82+
"value": 192000,
83+
"name": "192000"
84+
}
85+
],
86+
"type": "dropdown",
87+
}
88+
],
89+
90+
"Tracker": [
91+
{
92+
"title": "Region",
93+
"setting": "region",
94+
"x": 0.05,
95+
"y": 0.05,
96+
"width": 0.25,
97+
"height": 0.25,
98+
"first-frame": 1,
99+
"type": "rect"
100+
},
101+
102+
{
103+
"title": "Tracker type",
104+
"setting": "tracker-type",
105+
"value": "KCF",
106+
"values": [
107+
{
108+
"value": "KCF",
109+
"name": "KCF"
110+
},
111+
{
112+
"value": "MIL",
113+
"name": "MIL"
114+
},
115+
{
116+
"value": "BOOSTING",
117+
"name": "BOOSTING"
118+
},
119+
{
120+
"value": "TLD",
121+
"name": "TLD"
122+
},
123+
{
124+
"value": "MEDIANFLOW",
125+
"name": "MEDIANFLOW"
126+
},
127+
{
128+
"value": "MOSSE",
129+
"name": "MOSSE"
130+
},
131+
{
132+
"value": "CSRT",
133+
"name": "CSRT"
134+
}
135+
],
136+
"type": "dropdown",
137+
}
138+
],
139+
140+
"Stabilizer": [
141+
{
142+
"max": 100,
143+
"title": "Smoothing window",
144+
"min": 1,
145+
"setting": "smoothing-window",
146+
"value": 30,
147+
"type": "spinner"
148+
}
149+
],
150+
151+
"Object Detector": [
152+
{
153+
"value": "../yolo/yolov3.weights",
154+
"title": "Model Weights",
155+
"type": "text",
156+
"setting": "model-weights"
157+
},
158+
{
159+
"value": "../yolo/yolov3.cfg",
160+
"title": "Model Config",
161+
"type": "text",
162+
"setting": "model-config"
163+
},
164+
{
165+
"value": "../yolo/obj.names",
166+
"title": "Class names",
167+
"type": "text",
168+
"setting": "class-names"
169+
},
170+
{
171+
"title": "Processing Device",
172+
"setting": "processing-device",
173+
"value": "GPU",
174+
"values": [
175+
{
176+
"value": "GPU",
177+
"name": "GPU"
178+
},
179+
{
180+
"value": "CPU",
181+
"name": "CPU"
182+
}
183+
],
184+
"type": "dropdown",
185+
}
186+
]
187+
}

src/classes/info.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
USER_PROFILES_PATH = os.path.join(USER_PATH, "profiles")
6262
USER_PRESETS_PATH = os.path.join(USER_PATH, "presets")
6363
USER_TITLES_PATH = os.path.join(USER_PATH, "title_templates")
64+
PROTOBUF_DATA_PATH = os.path.join(USER_PATH, "protobuf_data")
6465
# User files
6566
BACKUP_FILE = os.path.join(BACKUP_PATH, "backup.osp")
6667
USER_DEFAULT_PROJECT = os.path.join(USER_PATH, "default.project")
@@ -70,7 +71,8 @@
7071
for folder in [
7172
USER_PATH, BACKUP_PATH, RECOVERY_PATH, THUMBNAIL_PATH, CACHE_PATH,
7273
BLENDER_PATH, TITLE_PATH, TRANSITIONS_PATH, PREVIEW_CACHE_PATH,
73-
USER_PROFILES_PATH, USER_PRESETS_PATH, USER_TITLES_PATH, EMOJIS_PATH ]:
74+
USER_PROFILES_PATH, USER_PRESETS_PATH, USER_TITLES_PATH, EMOJIS_PATH,
75+
PROTOBUF_DATA_PATH ]:
7476
if not os.path.exists(os.fsencode(folder)):
7577
os.makedirs(folder, exist_ok=True)
7678

src/images/cache/caption.png

13.8 KB
Loading

src/images/cache/objectdetector.png

11.9 KB
Loading

src/images/cache/stabilizer.png

14.3 KB
Loading

src/images/cache/tracker.png

13.3 KB
Loading

src/windows/main_window.py

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class MainWindow(updates.UpdateWatcher, QMainWindow):
101101
FoundVersionSignal = pyqtSignal(str)
102102
WaveformReady = pyqtSignal(str, list)
103103
TransformSignal = pyqtSignal(str)
104+
SelectRegionSignal = pyqtSignal(str)
104105
MaxSizeChanged = pyqtSignal(object)
105106
InsertKeyframe = pyqtSignal(object)
106107
OpenProjectSignal = pyqtSignal(str)

0 commit comments

Comments
 (0)