Skip to content

Commit

Permalink
rife-v4.25-heavy (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise authored Oct 31, 2024
1 parent 895c5aa commit bff73f1
Show file tree
Hide file tree
Showing 4 changed files with 411 additions and 16 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ By default models are exported with ensemble=False and Fast=True
- 67 = rife-v4.24 (ensemble=True)
- 68 = rife-v4.25 (ensemble=False)
- 69 = rife-v4.25-lite (ensemble=False)
- 70 = rife-v4.26 (ensemble=False)
- 70 = rife-v4.25-heavy (ensemble=False)
- 71 = rife-v4.26 (ensemble=False)

## My experimental custom models (only works with 2x)

- 71 = sudo_rife4 (ensemble=False / fast=True)
- 72 = sudo_rife4 (ensemble=True / fast=False)
- 73 = sudo_rife4 (ensemble=True / fast=True)
- 72 = sudo_rife4 (ensemble=False / fast=True)
- 73 = sudo_rife4 (ensemble=True / fast=False)
- 74 = sudo_rife4 (ensemble=True / fast=True)

- factor_num, factor_den: Factor of target frame rate. For example `factor_num=5, factor_den=2` will multiply input clip FPS by 2.5. Only rife-v4 model supports custom frame rate.

Expand Down
27 changes: 15 additions & 12 deletions RIFE/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ static void VS_CC rifeCreate(const VSMap* in, VSMap* out, [[maybe_unused]] void*
if (err)
d->skipThreshold = 60.0;

if (model < 0 || model > 73)
throw "model must be between 0 and 73 (inclusive)";
if (model < 0 || model > 74)
throw "model must be between 0 and 74 (inclusive)";

if (factorNum < 1)
throw "factor_num must be at least 1";
Expand Down Expand Up @@ -497,15 +497,18 @@ static void VS_CC rifeCreate(const VSMap* in, VSMap* out, [[maybe_unused]] void*
modelPath += "/rife-v4.25-lite_ensembleFalse";
break;
case 70:
modelPath += "/rife-v4.26_ensembleFalse";
modelPath += "/rife-v4.25_heavy_beta_ensembleFalse";
break;
case 71:
modelPath += "/sudo_rife4_ensembleFalse_fastTrue";
modelPath += "/rife-v4.26_ensembleFalse";
break;
case 72:
modelPath += "/sudo_rife4_ensembleTrue_fastFalse";
modelPath += "/sudo_rife4_ensembleFalse_fastTrue";
break;
case 73:
modelPath += "/sudo_rife4_ensembleTrue_fastFalse";
break;
case 74:
modelPath += "/sudo_rife4_ensembleTrue_fastTrue";
break;

Expand All @@ -531,13 +534,13 @@ static void VS_CC rifeCreate(const VSMap* in, VSMap* out, [[maybe_unused]] void*
rife_v4 = true;
else if (modelPath.find("rife4") != std::string::npos)
rife_v4 = true;
// rife 4.25 and 4.26 require more padding due to extra scales.
if (modelPath.find("rifev4.25") != std::string::npos)
padding = 64;
if (modelPath.find("rifev4.25-lite") != std::string::npos)
padding = 128;
if (modelPath.find("rifev4.26") != std::string::npos)
padding = 64;
// rife 4.25 and 4.26 require more padding due to extra scales.
if (modelPath.find("rifev4.25") != std::string::npos)
padding = 64;
if (modelPath.find("rifev4.25-lite") != std::string::npos)
padding = 128;
if (modelPath.find("rifev4.26") != std::string::npos)
padding = 64;
else if (modelPath.find("rife") == std::string::npos)
throw "unknown model dir type";

Expand Down
Binary file not shown.
Loading

0 comments on commit bff73f1

Please sign in to comment.