Skip to content

Commit

Permalink
the very rough sync gap mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Feb 17, 2022
1 parent dda20d7 commit 6b95b75
Show file tree
Hide file tree
Showing 4 changed files with 1,179 additions and 304 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Usage: realcugan-ncnn-vulkan -i infile -o outfile [options]...
-n noise-level denoise level (-1/0/1/2/3, default=-1)
-s scale upscale ratio (1/2/3/4, default=2)
-t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu
-c syncgap-mode sync gap mode (0/1/2, default=2)
-c syncgap-mode sync gap mode (0/1/2/3, default=3)
-m model-path realcugan model path (default=models-se)
-g gpu-id gpu device to use (-1=cpu, default=auto) can be 0,1,2 for multi-gpu
-j load:proc:save thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu
Expand All @@ -55,7 +55,7 @@ Usage: realcugan-ncnn-vulkan -i infile -o outfile [options]...
- `noise-level` = noise level, large value means strong denoise effect, -1 = no effect
- `scale` = scale level, 1 = no scaling, 2 = upscale 2x
- `tile-size` = tile size, use smaller value to reduce GPU memory usage, default selects automatically
- `syncgap-mode` = sync gap mode, 0 = no sync, 1 = accurate sync, 2 = rough sync
- `syncgap-mode` = sync gap mode, 0 = no sync, 1 = accurate sync, 2 = rough sync, 3 = very rough sync
- `load:proc:save` = thread count for the three stages (image decoding + realcugan upscaling + image encoding), using larger values may increase GPU usage and consume more GPU memory. You can tune this configuration with "4:4:4" for many small-size images, and "2:2:2" for large-size images. The default setting usually works fine for most situations. If you find that your GPU is hungry, try increasing thread count to achieve faster processing.
- `format` = the format of the image to be output, png is better supported, however webp generally yields smaller file sizes, both are losslessly encoded

Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static void print_usage()
fprintf(stdout, " -n noise-level denoise level (-1/0/1/2/3, default=-1)\n");
fprintf(stdout, " -s scale upscale ratio (1/2/3/4, default=2)\n");
fprintf(stdout, " -t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu\n");
fprintf(stdout, " -c syncgap-mode sync gap mode (0/1/2, default=2)\n");
fprintf(stdout, " -c syncgap-mode sync gap mode (0/1/2/3, default=3)\n");
fprintf(stdout, " -m model-path realcugan model path (default=models-se)\n");
fprintf(stdout, " -g gpu-id gpu device to use (-1=cpu, default=auto) can be 0,1,2 for multi-gpu\n");
fprintf(stdout, " -j load:proc:save thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu\n");
Expand Down Expand Up @@ -448,7 +448,7 @@ int main(int argc, char** argv)
std::vector<int> jobs_proc;
int jobs_save = 2;
int verbose = 0;
int syncgap = 2;
int syncgap = 3;
int tta_mode = 0;
path_t format = PATHSTR("png");

Expand Down Expand Up @@ -577,7 +577,7 @@ int main(int argc, char** argv)
return -1;
}

if (!(syncgap == 0 || syncgap == 1 || syncgap == 2))
if (!(syncgap == 0 || syncgap == 1 || syncgap == 2 || syncgap == 3))
{
fprintf(stderr, "invalid syncgap argument\n");
return -1;
Expand Down
Loading

0 comments on commit 6b95b75

Please sign in to comment.