zakaria-narjis commited on
Commit
eee716c
·
1 Parent(s): 6a151b2

Update dependencies

Browse files
.gitignore ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ temp
2
+
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ *.py[cod]
6
+ *$py.class
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # Distribution / packaging
12
+ .Python
13
+ build/
14
+ develop-eggs/
15
+ dist/
16
+ downloads/
17
+ eggs/
18
+ .eggs/
19
+ lib/
20
+ lib64/
21
+ parts/
22
+ sdist/
23
+ var/
24
+ wheels/
25
+ share/python-wheels/
26
+ *.egg-info/
27
+ .installed.cfg
28
+ *.egg
29
+ MANIFEST
30
+
31
+ # PyInstaller
32
+ # Usually these files are written by a python script from a template
33
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ *.py,cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+ cover/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+
76
+ # PyBuilder
77
+ .pybuilder/
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pyenv
88
+ # For a library or package, you might want to ignore these files since the code is
89
+ # intended to run in multiple environments; otherwise, check them in:
90
+ # .python-version
91
+
92
+ # pipenv
93
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
95
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
96
+ # install all needed dependencies.
97
+ #Pipfile.lock
98
+
99
+ # UV
100
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
101
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
102
+ # commonly ignored for libraries.
103
+ #uv.lock
104
+
105
+ # poetry
106
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
107
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
108
+ # commonly ignored for libraries.
109
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
110
+ #poetry.lock
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ #pdm.lock
115
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
116
+ # in version control.
117
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
118
+ .pdm.toml
119
+ .pdm-python
120
+ .pdm-build/
121
+
122
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
123
+ __pypackages__/
124
+
125
+ # Celery stuff
126
+ celerybeat-schedule
127
+ celerybeat.pid
128
+
129
+ # SageMath parsed files
130
+ *.sage.py
131
+
132
+ # Environments
133
+ .env
134
+ .venv
135
+ env/
136
+ venv/
137
+ ENV/
138
+ env.bak/
139
+ venv.bak/
140
+
141
+ # Spyder project settings
142
+ .spyderproject
143
+ .spyproject
144
+
145
+ # Rope project settings
146
+ .ropeproject
147
+
148
+ # mkdocs documentation
149
+ /site
150
+
151
+ # mypy
152
+ .mypy_cache/
153
+ .dmypy.json
154
+ dmypy.json
155
+
156
+ # Pyre type checker
157
+ .pyre/
158
+
159
+ # pytype static type analyzer
160
+ .pytype/
161
+
162
+ # Cython debug symbols
163
+ cython_debug/
164
+
165
+ # PyCharm
166
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
167
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
168
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
169
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
170
+ #.idea/
171
+
172
+ # PyPI configuration file
173
+ .pypirc
requirements.txt CHANGED
@@ -1,17 +1,15 @@
1
  opencv-python==4.10.0.84
2
  gdown==5.2.0
3
  gymnasium==0.29.1
4
- numpy==1.26.4
5
- Pillow==10.3.0
6
- scikit-learn==1.5.1
7
- tensordict==0.4.0
8
- torch==2.3.1
9
- torchvision==0.18.1
10
  tqdm==4.66.4
11
  pyyaml==6.0.1
12
- transformers==4.42.4
13
- tensorboard==2.17.0
14
- torchrl==0.4.0
15
- streamlit==1.36.0
16
  streamlit-image-comparison==0.0.4
17
  bokeh==2.4.3
 
1
  opencv-python==4.10.0.84
2
  gdown==5.2.0
3
  gymnasium==0.29.1
4
+ Pillow==11.1.0
5
+ scikit-learn==1.6.0
6
+ tensordict==0.6.1
7
+ torch==2.5.1
8
+ torchvision==0.20.1
 
9
  tqdm==4.66.4
10
  pyyaml==6.0.1
11
+ transformers==4.47.1
12
+ torchrl==0.6.0
13
+ streamlit==1.41.1
 
14
  streamlit-image-comparison==0.0.4
15
  bokeh==2.4.3
src/envs/__pycache__/dataset.cpython-311.pyc DELETED
Binary file (2.87 kB)
 
src/envs/__pycache__/edit_photo.cpython-311.pyc DELETED
Binary file (25.2 kB)
 
src/envs/__pycache__/env_dataloader.cpython-311.pyc DELETED
Binary file (2.59 kB)
 
src/envs/__pycache__/env_dataloader.cpython-312.pyc DELETED
Binary file (2.2 kB)
 
src/envs/__pycache__/features_extractor.cpython-311.pyc DELETED
Binary file (1.47 kB)
 
src/envs/__pycache__/features_extractor.cpython-312.pyc DELETED
Binary file (3.11 kB)
 
src/envs/__pycache__/image_dataset.cpython-311.pyc DELETED
Binary file (15 kB)
 
src/envs/__pycache__/image_dataset.cpython-312.pyc DELETED
Binary file (11.7 kB)
 
src/envs/__pycache__/new_edit_photo.cpython-311.pyc DELETED
Binary file (31.1 kB)
 
src/envs/__pycache__/photo_env.cpython-311.pyc DELETED
Binary file (20.8 kB)
 
src/envs/dehaze/src/dehaze/__pycache__/__init__.cpython-311.pyc DELETED
Binary file (263 Bytes)
 
src/envs/dehaze/src/dehaze/__pycache__/__init__.cpython-36.pyc DELETED
Binary file (256 Bytes)
 
src/envs/dehaze/src/dehaze/__pycache__/dark_prior_channel.cpython-311.pyc DELETED
Binary file (8.29 kB)
 
src/envs/dehaze/src/dehaze/__pycache__/dark_prior_channel.cpython-36.pyc DELETED
Binary file (5.31 kB)
 
src/sac/__pycache__/__init__.cpython-311.pyc DELETED
Binary file (166 Bytes)
 
src/sac/__pycache__/sac_algorithm.cpython-311.pyc DELETED
Binary file (14.7 kB)
 
src/sac/__pycache__/sac_inference.cpython-311.pyc DELETED
Binary file (6.63 kB)
 
src/sac/__pycache__/sac_networks.cpython-311.pyc DELETED
Binary file (12.4 kB)
 
src/sac/__pycache__/utils.cpython-311.pyc DELETED
Binary file (2.49 kB)
 
src/sac/sac_inference.py CHANGED
@@ -21,7 +21,7 @@ class InferenceAgent:
21
  return torch.round((batch_actions+1)/self.discretize_step)*self.discretize_step-1
22
 
23
  def load_backbone (self,backbone_path):
24
- self.backbone.load_state_dict(torch.load(backbone_path, map_location=self.device))
25
  self.actor = Actor(self.env,self.backbone).to(self.device)
26
  self.qf1 = SoftQNetwork(self.env,self.backbone).to(self.device)
27
  self.qf2 = SoftQNetwork(self.env,self.backbone).to(self.device)
 
21
  return torch.round((batch_actions+1)/self.discretize_step)*self.discretize_step-1
22
 
23
  def load_backbone (self,backbone_path):
24
+ self.backbone.load_state_dict(torch.load(backbone_path, map_location=self.device, weights_only=True))
25
  self.actor = Actor(self.env,self.backbone).to(self.device)
26
  self.qf1 = SoftQNetwork(self.env,self.backbone).to(self.device)
27
  self.qf2 = SoftQNetwork(self.env,self.backbone).to(self.device)
src/sac/utils.py CHANGED
@@ -13,7 +13,7 @@ def save_actor_head(actor_model, file_path):
13
 
14
  def load_actor_head(actor_model, file_path,device):
15
  # Load the state dictionaries from the file
16
- actor_head_state_dict = torch.load(file_path, map_location=device)
17
  # Load the state dictionaries into the model
18
  actor_model.fc1.load_state_dict(actor_head_state_dict['fc1'])
19
  actor_model.fc2.load_state_dict(actor_head_state_dict['fc2'])
@@ -32,7 +32,7 @@ def save_critic_head(critic_model, file_path):
32
 
33
  def load_critic_head(critic_model, file_path,device):
34
  # Load the state dictionaries from the file
35
- critic_head_state_dict = torch.load(file_path, map_location=device)
36
  # Load the state dictionaries into the model
37
  critic_model.fc1.load_state_dict(critic_head_state_dict['fc1'])
38
  critic_model.fc2.load_state_dict(critic_head_state_dict['fc2'])
 
13
 
14
  def load_actor_head(actor_model, file_path,device):
15
  # Load the state dictionaries from the file
16
+ actor_head_state_dict = torch.load(file_path, map_location=device,weights_only=True)
17
  # Load the state dictionaries into the model
18
  actor_model.fc1.load_state_dict(actor_head_state_dict['fc1'])
19
  actor_model.fc2.load_state_dict(actor_head_state_dict['fc2'])
 
32
 
33
  def load_critic_head(critic_model, file_path,device):
34
  # Load the state dictionaries from the file
35
+ critic_head_state_dict = torch.load(file_path, map_location=device,weights_only=True)
36
  # Load the state dictionaries into the model
37
  critic_model.fc1.load_state_dict(critic_head_state_dict['fc1'])
38
  critic_model.fc2.load_state_dict(critic_head_state_dict['fc2'])