<jupyter_start><jupyter_text>NOTE:  Set artistic to False if you're having trouble getting a good render.  Chances are it will work with the Stable model.<jupyter_code>colorizer = get_image_colorizer(artistic=True)<jupyter_output><empty_output><jupyter_text>Instructions source_urlType in a url to a direct link of an image.  Usually that means they'll end in .png, .jpg, etc.  NOTE: If you want to use your own image, you can set source_url to None and just upload the image to /test_images/ in Jupyter.  Just make sure that the source_path parameter matches the file you uploaded. source_pathName this whatever sensible image path (plus extension of jpg/png/ext) you want!  Sensible means the path exists and the file exists if source_url=None. render_factorThe default value of 35 has been carefully chosen and should work -ok- for most scenarios (but probably won't be the -best-). This determines resolution at which the color portion of the image is rendered. Lower resolution will render faster, and colors also tend to look more vibrant. Older and lower quality images in particular will generally benefit by lowering the render factor. Higher render factors are often better for higher quality images, but the colors may get slightly washed out.  result_pathDitto- don't change. How to Download a CopySimply shift+right click on the displayed image and click "Save Image As..."! Pro Tips1. You can evaluate how well the image is rendered at each render_factor by using the code at the bottom (that cell under "See how well render_factor values perform on a frame here"). 2. Keep in mind again that you can go up top and set artistic to False for the colorizer to use the 'Stable' model instead.  This will often tend to do better on portraits, and natural landscapes.   TroubleshootingIf you get a 'CUDA out of memory' error, you probably have the render_factor too high.  The max is 45 on 11GB video cards.  Colorize!!<jupyter_code>#NOTE:  Max is 45 with 11GB video cards. 35 is a good default
render_factor=35
#NOTE:  Make source_url None to just read from file at ./video/source/[file_name] directly without modification
source_url='https://upload.wikimedia.org/wikipedia/commons/e/e4/Raceland_Louisiana_Beer_Drinkers_Russell_Lee.jpg'
source_path = 'test_images/image.png'
result_path = None

if source_url is not None:
    result_path = colorizer.plot_transformed_image_from_url(url=source_url, path=source_path, render_factor=render_factor, compare=True)
else:
    result_path = colorizer.plot_transformed_image(path=source_path, render_factor=render_factor, compare=True)

show_image_in_notebook(result_path)<jupyter_output><empty_output><jupyter_text>See how well render_factor values perform on the image here<jupyter_code>#for i in range(10,46):
    #colorizer.plot_transformed_image(source_path, render_factor=i, display_render_factor=True, figsize=(10,10))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.05884377150722643, 'fraction_numerical': 0.008602890571231933, 'mean_word_length': 5.474387527839643, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '27808', 'license': 'MIT', 'n_tokens_mistral': 846, 'n_tokens_neox': 802, 'n_words': 362, 'path': 'ImageColorizer.ipynb', 'repo_name': 'Firerouge/DeOldify', 'size': '2906'}