ryefoxlime
commited on
Commit
•
8eb51e6
1
Parent(s):
7cf8e9f
updated the python project version
Browse files- .python-version +1 -1
- FER/prediction.py +1 -12
- pyproject.toml +32 -127
- requirements.in +132 -11
- uv.lock +0 -0
.python-version
CHANGED
@@ -1 +1 @@
|
|
1 |
-
3.
|
|
|
1 |
+
3.12
|
FER/prediction.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
from models.PosterV2_7cls import pyramid_trans_expr2
|
2 |
import torch
|
3 |
import os
|
4 |
from torchvision import transforms
|
@@ -13,17 +12,6 @@ else:
|
|
13 |
device = "cpu"
|
14 |
|
15 |
print(f"Using device: {device}")
|
16 |
-
# Predicting the model
|
17 |
-
# def prediction(model, image_path):
|
18 |
-
model = pyramid_trans_expr2(img_size=224, num_classes=7)
|
19 |
-
|
20 |
-
model = torch.nn.DataParallel(model)
|
21 |
-
model = model.to(device)
|
22 |
-
|
23 |
-
script_dir = os.path.dirname(os.path.abspath(__file__))
|
24 |
-
|
25 |
-
# Construct the full path to the model file
|
26 |
-
model_path = os.path.join(script_dir,"models","checkpoints","raf-db-model_best.pth")
|
27 |
|
28 |
image_arr = []
|
29 |
for foldername, subfolders, filenames in os.walk("../FER/Images/"):
|
@@ -32,6 +20,7 @@ for foldername, subfolders, filenames in os.walk("../FER/Images/"):
|
|
32 |
file_path = os.path.join(foldername, filename)
|
33 |
image_arr.append(f"{file_path}")
|
34 |
|
|
|
35 |
def predict(model, image_path):
|
36 |
from face_detection import face_detection
|
37 |
|
|
|
|
|
1 |
import torch
|
2 |
import os
|
3 |
from torchvision import transforms
|
|
|
12 |
device = "cpu"
|
13 |
|
14 |
print(f"Using device: {device}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
image_arr = []
|
17 |
for foldername, subfolders, filenames in os.walk("../FER/Images/"):
|
|
|
20 |
file_path = os.path.join(foldername, filename)
|
21 |
image_arr.append(f"{file_path}")
|
22 |
|
23 |
+
|
24 |
def predict(model, image_path):
|
25 |
from face_detection import face_detection
|
26 |
|
pyproject.toml
CHANGED
@@ -1,139 +1,44 @@
|
|
1 |
[project]
|
2 |
-
name = "
|
3 |
version = "0.1.0"
|
4 |
description = "Add your description here"
|
5 |
readme = "README.md"
|
6 |
-
requires-python = ">=3.
|
7 |
dependencies = [
|
8 |
-
"
|
9 |
-
"accelerate==1.1.1",
|
10 |
-
"aiohappyeyeballs==2.4.3",
|
11 |
-
"aiohttp==3.10.10",
|
12 |
-
"aiosignal==1.3.1",
|
13 |
-
"astunparse==1.6.3",
|
14 |
-
"attrs==24.2.0",
|
15 |
-
"beautifulsoup4==4.12.3",
|
16 |
-
"bitsandbytes==0.44.1",
|
17 |
-
"blinker==1.9.0",
|
18 |
-
"certifi==2024.8.30",
|
19 |
-
"charset-normalizer==3.4.0",
|
20 |
-
"click==8.1.7",
|
21 |
-
"colorama==0.4.6",
|
22 |
-
"colorama==0.4.6 ; platform_system == 'Windows'",
|
23 |
-
"contourpy==1.3.0",
|
24 |
-
"cycler==0.12.1",
|
25 |
-
"datasets==3.1.0",
|
26 |
-
"deepface==0.0.93",
|
27 |
-
"dill==0.3.8",
|
28 |
-
"filelock==3.16.1",
|
29 |
-
"fire==0.7.0",
|
30 |
-
"flask-cors==5.0.0",
|
31 |
-
"flask==3.0.3",
|
32 |
-
"flatbuffers==24.3.25",
|
33 |
-
"fonttools==4.54.1",
|
34 |
-
"frozenlist==1.5.0",
|
35 |
-
"fsspec==2024.9.0",
|
36 |
-
"gast==0.6.0",
|
37 |
-
"gdown==5.2.0",
|
38 |
-
"google-pasta==0.2.0",
|
39 |
-
"grpcio==1.67.1",
|
40 |
-
"gunicorn==23.0.0",
|
41 |
-
"h5py==3.12.1",
|
42 |
-
"huggingface-hub==0.26.2",
|
43 |
-
"idna==3.10",
|
44 |
-
"ipykernel>=6.29.5",
|
45 |
-
"ipywidgets>=8.1.5",
|
46 |
-
"itsdangerous==2.2.0",
|
47 |
-
"jinja2==3.1.4",
|
48 |
-
"joblib==1.4.2",
|
49 |
-
"jsonlines==4.0.0",
|
50 |
-
"keras==3.6.0",
|
51 |
-
"kiwisolver==1.4.7",
|
52 |
-
"libclang==18.1.1",
|
53 |
-
"lz4==4.3.3",
|
54 |
-
"markdown-it-py==3.0.0",
|
55 |
-
"markdown==3.7",
|
56 |
-
"markupsafe==3.0.1",
|
57 |
-
"matplotlib==3.9.2",
|
58 |
-
"mdurl==0.1.2",
|
59 |
-
"ml-dtypes==0.4.1",
|
60 |
-
"mpmath==1.3.0",
|
61 |
-
"mtcnn==1.0.0",
|
62 |
-
"multidict==6.1.0",
|
63 |
-
"multiprocess==0.70.16",
|
64 |
-
"namex==0.0.8",
|
65 |
-
"networkx==3.4.2",
|
66 |
-
"numpy==2.0.2",
|
67 |
-
"nvidia-cublas-cu12==12.4.5.8 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
68 |
-
"nvidia-cuda-cupti-cu12==12.4.127 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
69 |
-
"nvidia-cuda-nvrtc-cu12==12.4.127 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
70 |
-
"nvidia-cuda-runtime-cu12==12.4.127 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
71 |
-
"nvidia-cudnn-cu12==9.1.0.70 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
72 |
-
"nvidia-cufft-cu12==11.2.1.3 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
73 |
-
"nvidia-curand-cu12==10.3.5.147 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
74 |
-
"nvidia-cusolver-cu12==11.6.1.9 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
75 |
-
"nvidia-cusparse-cu12==12.3.1.170 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
76 |
-
"nvidia-nccl-cu12==2.21.5 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
77 |
-
"nvidia-nvjitlink-cu12==12.4.127 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
78 |
-
"nvidia-nvtx-cu12==12.4.127 ; platform_machine == 'x86_64' and platform_system == 'Linux'",
|
79 |
-
"opencv-python==4.10.0.84",
|
80 |
-
"opt-einsum==3.4.0",
|
81 |
-
"optree==0.13.0",
|
82 |
-
"packaging==24.2",
|
83 |
-
"pandas==2.2.3",
|
84 |
-
"peft==0.13.2",
|
85 |
-
"pillow==11.0.0",
|
86 |
-
"propcache==0.2.0",
|
87 |
-
"protobuf==5.28.3",
|
88 |
-
"psutil==6.1.0",
|
89 |
-
"pyarrow==18.0.0",
|
90 |
-
"pygments==2.18.0",
|
91 |
-
"pyparsing==3.2.0",
|
92 |
-
"pysocks==1.7.1",
|
93 |
-
"python-dateutil==2.9.0.post0",
|
94 |
-
"pytz==2024.2",
|
95 |
-
"pyyaml==6.0.2",
|
96 |
-
"regex==2024.11.6",
|
97 |
-
"requests==2.32.3",
|
98 |
-
"retina-face==0.0.17",
|
99 |
-
"rich==13.9.4",
|
100 |
-
"safetensors==0.4.5",
|
101 |
-
"scikit-learn==1.5.2",
|
102 |
-
"scipy==1.14.1",
|
103 |
-
"setuptools==75.4.0",
|
104 |
-
"six==1.16.0",
|
105 |
-
"soupsieve==2.6",
|
106 |
-
"sympy==1.13.1",
|
107 |
-
"tensorboard-data-server==0.7.2",
|
108 |
-
"tensorboard==2.18.0",
|
109 |
-
"tensorflow-intel==2.18.0",
|
110 |
-
"tensorflow-io-gcs-filesystem==0.31.0",
|
111 |
-
"tensorflow-io-gcs-filesystem==0.31.0 ; python_full_version < '3.12'",
|
112 |
-
"tensorflow==2.18.0",
|
113 |
-
"termcolor==2.5.0",
|
114 |
-
"tf-keras>=2.18.0",
|
115 |
-
"threadpoolctl==3.5.0",
|
116 |
-
"tokenizers==0.20.3",
|
117 |
"torch==2.5.1+cu124",
|
118 |
-
"torchaudio==2.5.1+cu124",
|
119 |
-
"torchsampler==0.1.2",
|
120 |
"torchvision==0.20.1+cu124",
|
121 |
-
"
|
122 |
-
"
|
123 |
-
"
|
124 |
-
"
|
125 |
-
"
|
126 |
-
"
|
127 |
-
"
|
128 |
-
"
|
129 |
-
"
|
130 |
-
"
|
131 |
-
"xxhash==3.5.0",
|
132 |
-
"yarl==1.17.1",
|
133 |
]
|
134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
[[tool.uv.index]]
|
|
|
136 |
url = "https://download.pytorch.org/whl/cu124"
|
|
|
137 |
|
138 |
-
[
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
[project]
|
2 |
+
name = "learninguv"
|
3 |
version = "0.1.0"
|
4 |
description = "Add your description here"
|
5 |
readme = "README.md"
|
6 |
+
requires-python = ">=3.12"
|
7 |
dependencies = [
|
8 |
+
"ruff>=0.7.3",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
"torch==2.5.1+cu124",
|
|
|
|
|
10 |
"torchvision==0.20.1+cu124",
|
11 |
+
"torchaudio==2.5.1+cu124",
|
12 |
+
"huggingface-hub>=0.26.2",
|
13 |
+
"timm>=1.0.11",
|
14 |
+
"thop>=0.1.1.post2209072238",
|
15 |
+
"deepface==0.0.93",
|
16 |
+
"bitsandbytes>=0.44.1",
|
17 |
+
"peft>=0.13.2",
|
18 |
+
"trl>=0.12.1",
|
19 |
+
"ninja==1.11.1.1",
|
20 |
+
"numpy>=1.26.4",
|
|
|
|
|
21 |
]
|
22 |
|
23 |
+
[tool.uv.sources]
|
24 |
+
torch = { index = "pytorch" }
|
25 |
+
torchvision = { index = "pytorch" }
|
26 |
+
torchaudio = { index = "pytorch" }
|
27 |
+
deepface = {git = "https://github.com/serengil/deepface", tag="v0.0.93"}
|
28 |
+
|
29 |
[[tool.uv.index]]
|
30 |
+
name = "pytorch"
|
31 |
url = "https://download.pytorch.org/whl/cu124"
|
32 |
+
explicit = true
|
33 |
|
34 |
+
[dependency-groups]
|
35 |
+
dev = [
|
36 |
+
"deepface>=0.0.93",
|
37 |
+
"numpy<2",
|
38 |
+
"opencv-python>=4.10.0.84",
|
39 |
+
"thop>=0.1.1.post2209072238",
|
40 |
+
"timm>=1.0.11",
|
41 |
+
"torch>=2.5.1",
|
42 |
+
"torchaudio>=2.5.1",
|
43 |
+
"torchvision>=0.20.1",
|
44 |
+
]
|
requirements.in
CHANGED
@@ -1,19 +1,140 @@
|
|
1 |
-
-
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
huggingface-hub==0.26.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
scikit-learn==1.5.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
torch==2.5.1+cu124
|
6 |
torchaudio==2.5.1+cu124
|
7 |
torchsampler==0.1.2
|
8 |
torchvision==0.20.1+cu124
|
9 |
-
|
10 |
-
|
|
|
11 |
transformers==4.46.2
|
12 |
-
datasets==3.1.0
|
13 |
-
peft==0.13.2
|
14 |
trl==0.12.0
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
absl-py==2.1.0
|
2 |
+
accelerate==1.1.1
|
3 |
+
aiohappyeyeballs==2.4.3
|
4 |
+
aiohttp==3.10.10
|
5 |
+
aiosignal==1.3.1
|
6 |
+
asttokens==2.4.1
|
7 |
+
astunparse==1.6.3
|
8 |
+
attrs==24.2.0
|
9 |
+
beautifulsoup4==4.12.3
|
10 |
+
bitsandbytes==0.44.1
|
11 |
+
blinker==1.9.0
|
12 |
+
certifi==2024.8.30
|
13 |
+
charset-normalizer==3.4.0
|
14 |
+
click==8.1.7
|
15 |
+
colorama==0.4.6
|
16 |
+
comm==0.2.2
|
17 |
+
contourpy==1.3.0
|
18 |
+
cycler==0.12.1
|
19 |
+
datasets==3.1.0
|
20 |
+
debugpy==1.8.8
|
21 |
+
decorator==5.1.1
|
22 |
+
deepface==0.0.93
|
23 |
+
dill==0.3.8
|
24 |
+
executing==2.1.0
|
25 |
+
filelock==3.16.1
|
26 |
+
fire==0.7.0
|
27 |
+
flask==3.0.3
|
28 |
+
flask-cors==5.0.0
|
29 |
+
flatbuffers==24.3.25
|
30 |
+
fonttools==4.54.1
|
31 |
+
frozenlist==1.5.0
|
32 |
+
fsspec==2024.9.0
|
33 |
+
gast==0.6.0
|
34 |
+
gdown==5.2.0
|
35 |
+
google-pasta==0.2.0
|
36 |
+
grpcio==1.67.1
|
37 |
+
gunicorn==23.0.0
|
38 |
+
h5py==3.12.1
|
39 |
huggingface-hub==0.26.2
|
40 |
+
idna==3.10
|
41 |
+
ipykernel==6.29.5
|
42 |
+
ipython==8.29.0
|
43 |
+
ipywidgets==8.1.5
|
44 |
+
itsdangerous==2.2.0
|
45 |
+
jedi==0.19.2
|
46 |
+
jinja2==3.1.4
|
47 |
+
joblib==1.4.2
|
48 |
+
jsonlines==4.0.0
|
49 |
+
jupyter-client==8.6.3
|
50 |
+
jupyter-core==5.7.2
|
51 |
+
jupyterlab-widgets==3.0.13
|
52 |
+
keras==3.6.0
|
53 |
+
kiwisolver==1.4.7
|
54 |
+
libclang==18.1.1
|
55 |
+
lz4==4.3.3
|
56 |
+
markdown==3.7
|
57 |
+
markdown-it-py==3.0.0
|
58 |
+
markupsafe==3.0.1
|
59 |
+
matplotlib==3.9.2
|
60 |
+
matplotlib-inline==0.1.7
|
61 |
+
mdurl==0.1.2
|
62 |
+
ml-dtypes==0.4.1
|
63 |
+
mpmath==1.3.0
|
64 |
+
mtcnn==1.0.0
|
65 |
+
multidict==6.1.0
|
66 |
+
multiprocess==0.70.16
|
67 |
+
namex==0.0.8
|
68 |
+
nest-asyncio==1.6.0
|
69 |
+
networkx==3.4.2
|
70 |
+
numpy==2.0.2
|
71 |
+
opencv-python==4.10.0.84
|
72 |
+
opt-einsum==3.4.0
|
73 |
+
optree==0.13.0
|
74 |
+
packaging==24.2
|
75 |
+
pandas==2.2.3
|
76 |
+
parso==0.8.4
|
77 |
+
peft==0.13.2
|
78 |
+
pillow==11.0.0
|
79 |
+
platformdirs==4.3.6
|
80 |
+
prompt-toolkit==3.0.48
|
81 |
+
propcache==0.2.0
|
82 |
+
protobuf==5.28.3
|
83 |
+
psutil==6.1.0
|
84 |
+
pure-eval==0.2.3
|
85 |
+
pyarrow==18.0.0
|
86 |
+
pygments==2.18.0
|
87 |
+
pyparsing==3.2.0
|
88 |
+
pysocks==1.7.1
|
89 |
+
python-dateutil==2.9.0.post0
|
90 |
+
pytz==2024.2
|
91 |
+
pywin32==308
|
92 |
+
pyyaml==6.0.2
|
93 |
+
pyzmq==26.2.0
|
94 |
+
regex==2024.11.6
|
95 |
+
requests==2.32.3
|
96 |
+
retina-face==0.0.17
|
97 |
+
rich==13.9.4
|
98 |
+
safetensors==0.4.5
|
99 |
scikit-learn==1.5.2
|
100 |
+
scipy==1.14.1
|
101 |
+
setuptools==75.4.0
|
102 |
+
six==1.16.0
|
103 |
+
soupsieve==2.6
|
104 |
+
stack-data==0.6.3
|
105 |
+
sympy==1.13.1
|
106 |
+
tensorboard==2.18.0
|
107 |
+
tensorboard-data-server==0.7.2
|
108 |
+
tensorflow==2.18.0
|
109 |
+
tensorflow-intel==2.18.0
|
110 |
+
tensorflow-io-gcs-filesystem==0.31.0
|
111 |
+
termcolor==2.5.0
|
112 |
+
tf-keras==2.18.0
|
113 |
+
thop==0.1.1.post2209072238
|
114 |
+
threadpoolctl==3.5.0
|
115 |
+
timm==1.0.11
|
116 |
+
tokenizers==0.20.3
|
117 |
torch==2.5.1+cu124
|
118 |
torchaudio==2.5.1+cu124
|
119 |
torchsampler==0.1.2
|
120 |
torchvision==0.20.1+cu124
|
121 |
+
tornado==6.4.1
|
122 |
+
tqdm==4.67.0
|
123 |
+
traitlets==5.14.3
|
124 |
transformers==4.46.2
|
|
|
|
|
125 |
trl==0.12.0
|
126 |
+
typing-extensions==4.12.2
|
127 |
+
tzdata==2024.2
|
128 |
+
urllib3==2.2.3
|
129 |
+
wcwidth==0.2.13
|
130 |
+
werkzeug==3.1.3
|
131 |
+
wheel==0.45.0
|
132 |
+
widgetsnbextension==4.0.13
|
133 |
+
wrapt==1.16.0
|
134 |
+
xxhash==3.5.0
|
135 |
+
yarl==1.17.1
|
136 |
+
torch==2.5.1
|
137 |
+
torchvision==0.20.1
|
138 |
+
torchaudio==2.5.1
|
139 |
+
speechrecogntion
|
140 |
+
pyttsx3
|
uv.lock
CHANGED
The diff for this file is too large to render.
See raw diff
|
|