diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 59 |
1 files changed, 49 insertions, 10 deletions
@@ -2,15 +2,47 @@ Neural Style Transfer done from the CLI using a VGG backbone and presented as an MP4. -Weights can be downloaded from [here](https://m1.afileditch.ch/ajjMsHrRhnikrrCiUXgY.pth). The downloaded file should be placed in `./weights/` and any file will be ignored from there when pushing, as seen in `./.gitignore`. Update: Alternatively, if the `./weights/` directory is empty, `./neuralart.py` will automatically download the aforementioned default weights. +Weights can be downloaded from [here](https://m1.afileditch.ch/ajjMsHrRhnikrrCiUXgY.pth). The downloaded file should be placed in `./weights/` and any file will be ignored from there when pushing, as seen in `./.gitignore`. Update: Alternatively, if the `./weights/` directory is empty, `./neuralart.py` will automatically download publicly available VGG19 weights for the user. + +More in depth information about Neural Style Transfer (NST) can be found in this great [paper](https://arxiv.org/abs/1705.04058). Make sure to check [Requirements](#requirements) and [Usage](#usage). ### Why use this in 2023 ? -Because Style Transfer hasn't changed drastically in terms of actual results in the past years. I personally find a certain beauty in inputting a style and content image rather than a well curated prompt with a dozen of switches. Consider this repo as a quick ***just works*** solution that can run on either CPU or GPU effectively. +Because Style Transfer hasn't changed drastically in terms of actual results in the past years. I personally find a certain beauty in inputting a style and content image rather than a well curated prompt with a dozen of switches. Consider this repo as a quick and simple ***just works*** solution that can run on both CPU and GPU effectively. + +I developed this tool as a means to obtain fancy images and visuals for me and my friends. It somehow grew into something bigger that is actually usable, so much so that I got to integrate it in a workflow in conjunction with [Stable Diffusion](https://github.com/CompVis/stable-diffusion) (see also [here](https://github.com/AUTOMATIC1111/stable-diffusion-webui)). + +### Requirements + +Clone the repository: + +```bash +git clone https://github.com/xAlpharax/neural-art +``` + +Create a virtual environment to separate the required packages from system-wide packages: + +```bash +virtualenv path/to/neural-art + +source path/to/neural-art/bin/activate +``` + +! When you're finished with the environment: + +```bash +# deactivate +``` + +All the required packages are listed in `./requirements.txt` as per python etiquette: + +```bash +pip install -r requirements.txt +``` ## Usage -The script sits comfortably in `./stylize.sh` so run it (strictly from the project directory): +The main script sits comfortably in `./stylize.sh` so run it from the project's directory: ```bash ./stylize.sh path/to/style_image path/to/content_image @@ -22,13 +54,20 @@ A helper script is also available to run `./stylize.sh` for each distinct pair o ./all.sh ``` -If, at any point, curious of the individual frames that comprise the generated `./content_in_style.mp4` check `./Output/` -There's also a (redundant) `./images.npy` file that contains raw array data. `./clear_dir.sh` removes redundant files each time they're no longer needed. +Moreover, `./all.sh` is aware of the a;ready rendered mp4 files in the current working directory and will skip stylizing the combinations that are already present. -### Requirements +### Output videos/images and temporary files -All requirements are specified in `./requirements.txt` as per python etiquette: +If, at any point, curious of the individual frames that comprise the generated `./content_in_style.mp4` check `./Output/` for PNG images with exactly that. Keep in mind that these files get removed and overwritten each time ./stylize.sh is called (this is also why running multiple instances of the script in `./stylize.sh` is advised against; if you need something batched/automated, try `./all.sh`) -```bash -pip install -r requirements.txt -``` +The `./images.npy` file contains raw numpy array data generated by `./neuralart.py` and is manipulated by `./renderer.py` to achieve the `./Output` directory of PNG images. + +Considering this workflow, `./clear_dir.sh` removes temporary files each time a new call to `./stylize.sh` is made. + +## Contribuiting + +Any sort of help, especially regarding the QoS of the project, is appreciated. Feel free to open an issue in the **Issues** tab and discuss the possible changes there. As of now, *neural-art* would be in great need of a clean and friendly arguments handler (i.e. like the ones the `argparse` python package provides) in order to provide a cleaner interface for working with `./neuralart.py` and/or `./stylize.sh`. + +Thank you. + +Happy neural-art-ing ! |