Skip to content

Commit 55f6103

Browse files
committed
Added integration with Object Detector effect
1 parent e3001da commit 55f6103

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

src/classes/effect_init.py

+37
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,42 @@
150150
"value": 30,
151151
"type": "spinner"
152152
}
153+
],
154+
155+
"Object Detector": [
156+
{
157+
"value": "../yolo/yolov3.weights",
158+
"title": "Model Weights",
159+
"type": "text",
160+
"setting": "model-weights"
161+
},
162+
{
163+
"value": "../yolo/yolov3.cfg",
164+
"title": "Model Config",
165+
"type": "text",
166+
"setting": "model-config"
167+
},
168+
{
169+
"value": "../yolo/obj.names",
170+
"title": "Class names",
171+
"type": "text",
172+
"setting": "class-names"
173+
},
174+
{
175+
"title": "Processing Device",
176+
"setting": "processing-device",
177+
"value": "GPU",
178+
"values": [
179+
{
180+
"value": "GPU",
181+
"name": "GPU"
182+
},
183+
{
184+
"value": "CPU",
185+
"name": "CPU"
186+
}
187+
],
188+
"type": "dropdown",
189+
}
153190
]
154191
}

src/effects/icons/objectdetector.png

3.82 KB
Loading

src/windows/process_effect.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,21 @@ def generateJson(self, protobufPath):
372372
# Get processing start frame
373373
print(self.context["region"])
374374
jsonString +=',"first_frame": %d' % (self.context["region"]["first-frame"])
375-
375+
376+
# Special case where more info is needed for the JSON string
377+
if self.effect_name == "Object Detector":
378+
modelweightsPath = self.context["model-weights"]
379+
jsonString += ', "model_weights": "%s"' % modelweightsPath
380+
381+
modelConfigPath = self.context["model-config"]
382+
jsonString += ', "model_configuration": "%s"' % modelConfigPath
383+
384+
classNamesPath = self.context["class-names"]
385+
jsonString += ', "classes_file": "%s"' % classNamesPath
386+
387+
processingDevice = self.context["processing-device"]
388+
jsonString += ', "processing_device": "%s"' % processingDevice
389+
376390
# Finish JSON string
377391
jsonString+='}'
378392
return jsonString

src/windows/views/timeline_webview.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2958,10 +2958,11 @@ def addEffect(self, effect_names, position):
29582958
if js_position == 0 or (clip.data["position"] <= js_position <= clip.data["position"] + (clip.data["end"] - clip.data["start"])):
29592959
log.info("Applying effect to clip")
29602960
log.info(clip)
2961-
2961+
print(name)
2962+
print(effect_options)
29622963
# Handle custom effect dialogs
29632964
if name in effect_options:
2964-
2965+
29652966
# Get effect options
29662967
effect_params = effect_options.get(name)
29672968

0 commit comments

Comments
 (0)