From 4b632555b5baf3d84630fb3ecd7379e0ca203159 Mon Sep 17 00:00:00 2001 From: Brett Kuprel Date: Fri, 1 Jul 2022 23:39:48 -0400 Subject: [PATCH] models_root command line argument --- .gitignore | 1 + README.md | 8 ++++---- image_from_text.py | 5 ++++- setup.py | 5 ++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index fe144d8..acbfd20 100755 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ *.egg dist build +README diff --git a/README.md b/README.md index 97da721..922eada 100644 --- a/README.md +++ b/README.md @@ -37,14 +37,14 @@ text = "a comfy chair that looks like an avocado" image = model.generate_image(text) display(image) ``` -![Avocado Armchair](examples/avocado_armchair.png) +![Avocado Armchair](https://github.com/kuprel/min-dalle/raw/main/examples/avocado_armchair.png) ```python text = "trail cam footage of gollum eating watermelon" image = model.generate_image(text, seed=1) display(image) ``` -![Gollum Trailcam](examples/gollum_trailcam.png) +![Gollum Trailcam](https://github.com/kuprel/min-dalle/raw/main/examples/gollum_trailcam.png) ### Command Line @@ -54,9 +54,9 @@ Use `image_from_text.py` to generate images from the command line. ```bash $ python image_from_text.py --text='artificial intelligence' --seed=7 ``` -![Artificial Intelligence](examples/artificial_intelligence.png) +![Artificial Intelligence](https://github.com/kuprel/min-dalle/raw/main/examples/artificial_intelligence.png) ```bash $ python image_from_text.py --text='court sketch of godzilla on trial' --mega ``` -![Godzilla Trial](examples/godzilla_on_trial.png) \ No newline at end of file +![Godzilla Trial](https://github.com/kuprel/min-dalle/raw/main/examples/godzilla_on_trial.png) \ No newline at end of file diff --git a/image_from_text.py b/image_from_text.py index f85ac1c..9d151e2 100644 --- a/image_from_text.py +++ b/image_from_text.py @@ -12,6 +12,7 @@ parser.set_defaults(mega=False) parser.add_argument('--text', type=str, default='alien life') parser.add_argument('--seed', type=int, default=-1) parser.add_argument('--image_path', type=str, default='generated') +parser.add_argument('--models_root', type=str, default='pretrained') parser.add_argument('--token_count', type=int, default=256) # for debugging @@ -38,11 +39,12 @@ def generate_image( text: str, seed: int, image_path: str, + models_root: str, token_count: int ): model = MinDalle( is_mega=is_mega, - models_root='pretrained', + models_root=models_root, is_reusable=False, sample_token_count=token_count, is_verbose=True @@ -65,5 +67,6 @@ if __name__ == '__main__': text=args.text, seed=args.seed, image_path=args.image_path, + models_root=args.models_root, token_count=args.token_count ) \ No newline at end of file diff --git a/setup.py b/setup.py index 11251c2..ea8a81a 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,14 @@ import setuptools +from pathlib import Path setuptools.setup( name='min-dalle', description = 'min(DALLĀ·E)', - version='0.2.0', + long_description=(Path(__file__).parent / "README").read_text(), + version='0.2.5', author='Brett Kuprel', author_email='brkuprel@gmail.com', + url='https://github.com/kuprel/min-dalle', packages=[ 'min_dalle', 'min_dalle.models'