diff options
author | Michael Foiani <sotech117@michaels-mbp-4.devices.brown.edu> | 2022-05-10 01:32:39 -0400 |
---|---|---|
committer | Michael Foiani <sotech117@michaels-mbp-4.devices.brown.edu> | 2022-05-10 01:32:39 -0400 |
commit | 8b3745de9f8d411c99ecfc0e3c9b63c7b2a7ac71 (patch) | |
tree | 44325c93b8bd47422b7528a69c19306961a583d0 /main.py | |
parent | c3a8fff5d9465b362214d84d30d9b1212d58722f (diff) |
Add final examples, remove unused data, fix some comments. Good to go :)HEADsubmission
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -65,7 +65,7 @@ def train(model: YourModel): def main(): """ Main function. """ # -------------------------------------------------------------------------------------------------------------- - # PART 1 : parse the arguments # + # PART 1 : parse the arguments # -------------------------------------------------------------------------------------------------------------- if os.path.exists(ARGS.content): ARGS.content = os.path.abspath(ARGS.content) @@ -78,7 +78,7 @@ def main(): os.chdir(sys.path[0]) # -------------------------------------------------------------------------------------------------------------- - # PART 2 : read and process the style and content images # + # PART 2 : read and process the style and content images # -------------------------------------------------------------------------------------------------------------- # 1) read content and style images content_image = imread(ARGS.content) @@ -87,7 +87,7 @@ def main(): style_image = transform.resize(style_image, content_image.shape, anti_aliasing=True) # -------------------------------------------------------------------------------------------------------------- - # PART 3 : make and train our model # + # PART 3 : make and train our model # -------------------------------------------------------------------------------------------------------------- # 1) initialize our model class my_model = YourModel(content_image=content_image, style_image=style_image) @@ -95,7 +95,7 @@ def main(): train(my_model) # -------------------------------------------------------------------------------------------------------------- - # PART 4 : save and show result from final epoch # + # PART 4 : save and show result from final epoch # -------------------------------------------------------------------------------------------------------------- # model.x is the most recent image created by the model result_tensor = my_model.x @@ -105,7 +105,6 @@ def main(): # store + show the final result :) plt.imshow(final_image) print('\nDONE: saved the final result to out/results/{}.'.format(ARGS.savefile)) - # plt.show() ARGS = parse_args() |