From 8b3745de9f8d411c99ecfc0e3c9b63c7b2a7ac71 Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Tue, 10 May 2022 01:32:39 -0400 Subject: Add final examples, remove unused data, fix some comments. Good to go :) --- main.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index 660e99e0..267e8c0c 100644 --- a/main.py +++ b/main.py @@ -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() -- cgit v1.2.3-70-g09d2