mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-07-16 10:03:42 -07:00
code release
This commit is contained in:
parent
b941ba41a3
commit
a902f11f74
354 changed files with 826570 additions and 1 deletions
21
resources/gfx/QXImageSequenceDB.py
Normal file
21
resources/gfx/QXImageSequenceDB.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from pathlib import Path
|
||||
|
||||
from PyQt6.QtCore import *
|
||||
from PyQt6.QtGui import *
|
||||
from xlib import path as lib_path
|
||||
from xlib.qt.gui.from_file import QXImage_from_file
|
||||
from xlib.qt.gui.QXImageSequence import QXImageSequence
|
||||
|
||||
|
||||
class QXImageSequenceDB:
|
||||
cached = {}
|
||||
|
||||
def _get(dir_path : Path, fps, color=None):
|
||||
key = (dir_path, fps, color)
|
||||
result = QXImageSequenceDB.cached.get(key, None)
|
||||
if result is None:
|
||||
image_paths = lib_path.get_files_paths(dir_path)
|
||||
result = QXImageSequenceDB.cached[key] = QXImageSequence(frames=[QXImage_from_file (image_path, color) for image_path in image_paths], fps=fps)
|
||||
return result
|
||||
|
||||
def icon_loading(color=None) -> QXImageSequence: return QXImageSequenceDB._get(Path(__file__).parent / 'sequences' / 'icon_loading', fps=30, color=color)
|
Loading…
Add table
Add a link
Reference in a new issue