Flame Machine Learning Timewarp, now on Linux and Mac

Just wanted to reply that this works great to deal with fluid morphs, just take the first frame and few frames in of the second clip and choose 1/4 or depending on how many frames you need and viola a nice fluid morph works out so far fairly simple.

3 Likes

Hi Andriy, I’d like to try re install manually that miniconda thing so I can use CUDA to timewarp.
In your explanation below, I think there must be something wrong as I don’t have any miniconda folder in the “bundle” one… So I can remove the folder in ~/flameTimewarpML but I get an error when launching
/bin/sh ~/flameTimewarpML/bundle/miniconda.package/Miniconda3-Linux-x86_64.sh -b -p ~/flameTimewarpML/miniconda3

Any clue?

True, I just realised that the unpacking and installing part of script is cleaning up its intermediate installation files on completion.
If your machine connected to internet yo may just get one from anaconda website, I’m using python3.8 bundles:
https://docs.conda.io/en/latest/miniconda.html

Otherwise just amend the flameTimewarpML script to keep packages folder - search for ‘miniconda.package’ around line 352, you’re looking for a string that starts with "cmd = ‘rm -rf ‘ + os.path.join…” and need comment out os.system(cmd) that follows, this way the packages should be kept.

Did that but unfortunately, no luck still stuck with CPU only. Thx anyway. :wink:

There’ll be a multi-threaded CPU mode for Mac and Linux in the next version, so it should be considerably faster by utilising multiple cpu cores

2 Likes

Wonderful. :slight_smile:

1 Like

Just did a quick test at 1/2 and it works wonderful on a Z8 P6000 card.
I got an error an a machine with K6000 card, but will take a look at that one later.
thanks a lot. This will definitely come in handy in future jobs.

Found it on pytorch site for intalling it for cuda11 specifically:

pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

1 Like

I’m really curious to try this! Can you explain it a little more clearly?

1 Like

Hi guys, there’s something pretty cool for you to check out, it is about speed and multithreading.

  • Linux GPU renders runs up to 10x faster now on my side
  • MacOS multi-threading with automatic thread count estimation based on free ram and image size
  • CPU-only mode on linux

Please give this beta a test drive if you can and dm or github should there be any issues, thank you!

1 Like

BOOM! Thanks, Andriy!

1 Like

I’ve used it for 3-4 fluid morphs already in production, the next update after 0.2.0 will be gui for simple fluid morph module - select two clips of the same lenght, right-click and it renders the transition, and then maybe timeline transition as well

6 Likes

its a total hack but it works amazingly, say clip A morphs to clip B, what i do is find the first frame that A starts the morph and make that my frame 1 in new clip and find the frame that its finished in clip B and make that frame 2 in new clip then right clip and do the new timewarp to take place over five frames or whatever and viola you have your fluid morph done via machine learning, this is the best way I have found to reproduce these in a really quick way. Hope that makes sense?
PS I usually just do it on the desktop and ctrl alt shift individual frames out and once the fluid morph is complete I add those to the track above

1 Like

The way I’m doing it is to render pairs of incoming-outgoing frames at certain position along the transition duration. Say you have 10 frames morph so there are two plates aligned at frame one, and it will be a pair of plateA frame1 -> plateB frame1, plateA frame2 -> plateB frame2 … plateA frame10 -> plateB frame10. Then I run it through inference_img with considerably large --exp value (say, 4) and I have 10 sequences for each frame of the transition 16 frames long each. Then I timewarp them with nearest in te style of an original flame fluid morph setup with muxing them at specific position. But it is if you’re really desparately need it now, there’s a way write a rational transform between two and then it will become just right-click quickie

1 Like

No, I’m not dealing with a specific FM shot now. Just curious. Always curious to hear of a better way to handle these horrible things :grinning:

2 Likes

Currently testing slomos on a Mac. Works very well, at least on a shot of girl on a white cyc. Next step will be to test it on “problematic” clips, such as patterned backgrounds and overlapping movements.
@talosh Do you think higher resolution gives the ML more pixels to work with, hence better a result?

1 Like

It does not seem to be that linear but worth investigating more. The default model - model/RIFE_HD.py does have internal switch to be able to use two resolutions for evaluating flow motion, currently default is half and optional set to quater. I’ve played with setting it to full and it does have some very minor results on small motions like leaves and so on, but then it seem to have some troubles with understanding larger motions when larger parts are moving across the frame. There is a scientific paper on the algorythm worth to check: https://arxiv.org/pdf/2011.06294.pdf I’m really keen to dive deeper into ML part of it and especially bespoke training so I hope it won’t take long to build basic fluid morph and varispeed timewarps functionality before really diving there.

3 Likes

FYI Looks like it works fine with cuda 11.2 and newer drivers, those on cuda 11+ for workaround see: Support for RTX 30 series · Issue #5 · talosh/flameTimewarpML · GitHub

1 Like

I found this case scenario where, as Chloe’s hand moves towards camera overlapping her own arm, the ML has a tough time knowing what to do. To be fair, it’s at 8th speed so there weren’t many frames to look at but it’s a good reference of where to watch out for artifacts. The rest looks excellent!

2 Likes

The guys at GitHub - hzwer/arXiv2020-RIFE: RIFE: Real Time Video Frame Rate Enhancement are updating their model from time to time and I’m really keen to look into custom training after the basics are done, so there’s a hope for improvement. I found it failing sometimes in cases when flame default timewarp warps rather correctly so there is definitely a room for improvement

3 Likes