PrevPrevious commit
add --device for fast_neural_style
  • Loading branch information
@shink
shink committedSep 23, 2024
commit 2846161e5b0eee8d55b7e4a63d30380e802fb12b
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,6 +28,7 @@ python neural_style/neural_style.py eval --content-image </path/to/content/image
- `--content-scale`: factor for scaling down the content image if memory is an issue (eg: value of 2 will halve the height and width of content-image)
- `--cuda`: set it to 1 for running on GPU, 0 for CPU.
- `--mps`: set it to 1 for running on macOS GPU
- `--device DEVICE`: backend device to run on, 'cpu' by default.

Train model

Expand All@@ -42,6 +43,7 @@ There are several command line arguments, the important ones are listed below
- `--save-model-dir`: path to folder where trained model will be saved.
- `--cuda`: set it to 1 for running on GPU, 0 for CPU.
- `--mps`: set it to 1 for running on macOS GPU
- `--device DEVICE`: backend device to run on, 'cpu' by default.

Refer to `neural_style/neural_style.py` for other command line arguments. For training new models you might have to tune the values of `--content-weight` and `--style-weight`. The mosaic style model shown above was trained with `--content-weight 1e5` and `--style-weight 1e10`. The remaining 3 models were also trained with similar order of weight parameters with slight variation in the `--style-weight` (`5e10` or `1e11`).

Expand Down