Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

/weights*
/input*
/results*

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
Adjustment to the original repository, which allows to run it on weaker cards.<br>
Uses chunking/patching.<br>

Currently, original repo installation steps will result in wrong dependencies.<br>
So instead, install like this: `pip install --upgrade-strategy only-if-needed -r requirements.txt`

Or you can download the full setup from here https://github.com/IgorAherne/Shadow_R/releases/tag/latest <br>
This way you won't need to run any pip installs.

If you need neural nets, get them from google drive of the original repo<br>
If the drive is unaccessible, you can get them from here too [Release](https://github.com/IgorAherne/Shadow_R/releases/tag/original_weights)

Launch via `python ./test.py --chunk_size 512` or `--chunk_size 256` etc<br>

arguments and their default values (see test.py):<br>
`--test_dir = ./ShadowDataset/test` where the input images are<br>
`--input_dir = ./input/`<br>
`--output_dir = ./output/`<br>
`--chunk_size = 512` size of sliding window, to split the work into smaller pieces, for performance. Careful, might create seams<br>
`--overlap = 64` overlap among the windows, to hide possible seams<br>


Original repo description:

&nbsp;

<div align="center">
Expand Down
43 changes: 43 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Custom PyTorch index for CUDA 11.3
--extra-index-url https://download.pytorch.org/whl/cu113

# Core PyTorch ecosystem - pinned versions
torch==1.11.0+cu113
torchvision==0.12.0+cu113

# Core dependencies with strict versions
numpy==1.24.3 # Compatible with PyTorch 1.11
typing-extensions==4.12.2 # Required by PyTorch

# Deep Learning Framework Dependencies
pytorch-lightning==1.9.0 # Compatible with torch 1.11
torchmetrics==0.11.4 # Compatible with torch 1.11
timm==1.0.11
einops==0.8.0

# Vision and Image Processing
kornia==0.7.4
kornia-rs==0.1.7
Pillow==11.0.0
opencv-python==4.10.0.84
scikit-image==0.24.0

# Scientific Computing
scipy==1.14.1
scikit-learn==1.5.2
matplotlib==3.9.3

# Additional Required Dependencies
joblib==1.4.2 # For scikit-learn
threadpoolctl==3.5.0 # For scikit-learn
networkx==3.4.2 # For scikit-image
tifffile==2024.9.20 # For scikit-image
imageio==2.36.1 # For scikit-image
PyYAML==6.0.2 # For pytorch-lightning
fsspec==2024.10.0 # For pytorch-lightning
packaging==24.2
tqdm==4.67.1

# Ensure proper package building
setuptools>=63.2.0
wheel>=0.37.0
Loading