models_root command line argument

main
Brett Kuprel 2 years ago
parent 21c633b56e
commit 4b632555b5
  1. 1
      .gitignore
  2. 8
      README.md
  3. 5
      image_from_text.py
  4. 5
      setup.py

1
.gitignore vendored

@ -14,3 +14,4 @@
*.egg
dist
build
README

8
README.md vendored

@ -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)
![Godzilla Trial](https://github.com/kuprel/min-dalle/raw/main/examples/godzilla_on_trial.png)

@ -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
)

@ -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'

Loading…
Cancel
Save