Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix28/add an entry point #30

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,6 @@ images/*processed*
images/*quantize*

# pycharm
.idea/
.idea/
/.project
/.pydevproject
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# Changelog
All notable changes to this project will be documented in this file.

## 1.1.1 - 19 sept 2024
* Migrate to pyproject.toml module format
* Keep setuptools version inside setup.py, and permit to be overwritten by APPLICATION_VERSION environment variable
* Define submodule one by one `models`, `palettes` and `utility`
*
* ``image-go-nord`` CLI entry point
* Define a consistent ``argpare`` parser
* Define a class `ImageGoNordCLI` dedicated to the entry point
* Exit code management
* Define property getter/setter for `target`, `source` and `size`, where the logic is apply
* Force argparse to use they properties
* Add support for use files or directories as `target` and `source`
* Add support for `--add` it support colors, palette file, color name
* Add support for AVG `--add`
* Add support for AI `--ai` it use coloration over AI
* Add support for quantize `--quantize`
* Add support for `--resize` it permit to force size during the pre-processing
* Update README.md for introduce image-go-nord CLI
* Migrate pytest to pyproject.toml module format
* Add ``image-go-nord`` CLI test file
8 changes: 6 additions & 2 deletions ImageGoNord/GoNord.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,12 @@ def convert_image_by_model(self, image, use_model_cpu=False):
os.path.exists(os.path.dirname(palette_net.__file__) + '/FE.state_dict.pt')
and os.path.exists(os.path.dirname(palette_net.__file__) + '/RD.state_dict.pt')
):
FE.load_state_dict(torch.load(pkg_resources.open_binary(palette_net, "FE.state_dict.pt")))
RD.load_state_dict(torch.load(pkg_resources.open_binary(palette_net, "RD.state_dict.pt")))
FE.load_state_dict(torch.load(
pkg_resources.open_binary(palette_net, "FE.state_dict.pt"), weights_only=True)
)
RD.load_state_dict(torch.load(
pkg_resources.open_binary(palette_net, "RD.state_dict.pt"), weights_only=True)
)
else:
self.load_and_save_models()

Expand Down
12 changes: 9 additions & 3 deletions ImageGoNord/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# gonord version
__version__ = "1.1.0"

from ImageGoNord.GoNord import *
from .GoNord import NordPaletteFile
from .GoNord import GoNord

__all__ = [
"NordPaletteFile",
"GoNord",
]
# gonord version use for build process
__version__ = "1.1.1"
Loading