Issue with colorization loop render_factor=i causing render factor to increase
See original GitHub issueI been trying this today and in VideoColorizer the colorization code has a bug.
for i in range(10,45,2):
colorizer.vis.plot_transformed_image('video/bwframes/' + file_name + '/00001.jpg', render_factor=i, display_render_factor=True, figsize=(8,8))
Notice that render_factor=i which makes each frame a higher render factor to the point where it will run out of memory and crash.
I fixed by doing render_factor=render_factor
Edit: Render factor is set here

In fact this is my complete code which now successfully colorizes the video on my modest GTX 1050 Ti
for i in range(10,45,2):
colorizer.vis.plot_transformed_image('video/bwframes/' + file_name + '/00001.jpg', render_factor=i, display_render_factor=True, figsize=(8,8))
torch.cuda.empty_cache()
gc.collect()
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Colorize Black and White Photos
Render Factor defines the resolution at which the colorization is done. Lower resolution is faster and the result is usually more colorful. Especially...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This seems a bit one sided. Just think about it- why exactly do I owe this to you…?
I’m just sharing research. You didn’t pay for it, nor am I getting paid to play customer service. If you’re not willing to read and are that ready to waste others’ time, I’d consider that quite rude.
When you work in production, you do tons of tests. It doesn’t matter if you use closed-source software, which can be an even be a bigger nightmare. Trying to meet perishable deadlines, even in a big VFX studio, you need to find workarounds for workarounds, for your workarounds when your 3rd-string fall-backs fail and the client pushed the deadline back by a month. It doesn’t matter whether you use After Effects, Maya, or something that has open source code. You need to be a hacker at heart, even if you’re an artist and no excuses are allowed when big money is on the line. You have to be like Dustin Hoffman in Wag the Dog. That’s my mantra, “This is nothing. Try a ten AM script meeting, coked to the gills, no sleep and you haven’t even read the treatment.”
The aforementioned closed-source apps can be even worse, because you can’t access the source, can’t reach the dev team to even pose a question, the customer service people know as much about the what we do as a blind hooker, and you have to hope Adobe or Autodesk decide to patch things, if ever.
This was my first look at jupyter notebooks and it didn’t seem very user-friendly, so I worked around it. And yes, this is not the most user-friendly script on Github. Who cares? The developers wrote 8 paragraphs explaining why it is the way it is. They made it for them, not for us, and just let it loose in the wild to a thankless world. Dude’s still smiling in his avatar and I’m laughing while smoking on my porch. I’m happy there’s even software like this because I’m on a mac and don’t have access to CUDA. Be a little greatful, ffs.
If you don’t like it, just don’t use it. There’s plenty of other simpler colorization tools, with different looks. They don’t all work with video, but you can just output an image sequence and batch them, even if you just dump the whole script in a function and use a
forloop, you can build the video with any industry-standard video app or ffmpeg. It will take you like 5 minutes. When you work in production, you work with uncompressed frames, not mp4s, so this is standard practice. I work in 32-bit linear workflow and my next task is to figure out how to make these things work with EXR float files.Check out colorization by richzhang. It uses 2 siggraph models to color images. Script is like 50 lines of code. Renders nearly instantly. Not the greatest, but not terrible, and you can augment output from different apps and scripts by compositing them to get what you want.
And you can call me whatever you want, kid. After going through the meat grinder of life, being called a jerk is a highlight.
☕️🚬