Skip to content

Commit

Permalink
5.0 Beta 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaida12345 committed Jul 9, 2022
1 parent 4de4bcd commit db94901
Show file tree
Hide file tree
Showing 82 changed files with 5,443 additions and 624 deletions.
Binary file modified .DS_Store
Binary file not shown.
17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ Note: If mac says the app was damaged / unknown developer, please go to `System
## Privacy
This app works completely offline and requires no internet connection. Nothing is collected or stored, expect for:
- Your settings stored in its [containter](https://developer.apple.com/documentation/foundation/1413045-nshomedirectory/).
- Temp images in during comparison. (These files will be deleted when the windows is closed.)
- Temp images during processing in its container, the existance would only last for three lines of code, after which it is deleted.
- Output files and logs (if you turn on "enable log" or "enable dev" in preference) in its output path.
- Temp images during processing in its [containter](https://developer.apple.com/documentation/foundation/1413045-nshomedirectory/), the existance would only last for three lines of code, after which it is deleted.

If the app crashes, please choose not to share crash log with Apple.

## Models
The models where obtained from [waifu2x-caffe](https://github.com/lltcggie/waifu2x-caffe), and translated to coreML via [coremltools](https://github.com/apple/coremltools).
The waifu2x models where obtained from [waifu2x-caffe](https://github.com/lltcggie/waifu2x-caffe), and translated to coreML via [coremltools](https://github.com/apple/coremltools).

Other models are:
- [dain-ncnn-vulkan](https://github.com/nihui/dain-ncnn-vulkan)
Expand All @@ -41,18 +39,11 @@ When processing a standard 1080p image (1920 × 1080) using Waifu2x Caffe, MacBo
## Interface
This app was written with [SwiftUI](https://developer.apple.com/xcode/swiftui/).

<img width="2000" alt="Interface" src="https://user-images.githubusercontent.com/91354917/158416387-74fb8c62-f38a-4814-b992-6706d4747948.png">
<img width="2024" alt="Screen Shot 2022-07-07 at 7 16 07 PM" src="https://user-images.githubusercontent.com/91354917/177738899-7d1848e5-83a3-40f9-be21-4cbee768aa95.png">


## Preview
<img width="1417" alt="Screen Shot 2021-11-29 at 2 44 41 PM" src="https://user-images.githubusercontent.com/91354917/143820789-45edbf68-a0c5-4478-be80-b26da1a3ce9c.png">

<img width="1013" alt="Screen Shot 2022-02-22 at 6 15 29 PM" src="https://user-images.githubusercontent.com/91354917/155111707-9ceff33a-d786-40a6-be7e-836f9475074f.png">


## Denoise Level
You can compare results from different model by choosing Compare > Compare Denoise Levels. Example:
<img width="1446" alt="Screen Shot 2021-11-29 at 5 58 27 PM" src="https://user-images.githubusercontent.com/91354917/143847147-b6b12fee-9761-4dab-8899-fa49ea02c63f.png">
![Untitled-1](https://user-images.githubusercontent.com/91354917/177736461-f9a15b8e-fdda-4808-bd28-2c53d16e3b2e.png)

## Credits
- [waifu2x-ios](https://github.com/imxieyi/waifu2x-ios) for nearly all the algorithms used to enlarge images.
Expand Down
89 changes: 56 additions & 33 deletions waifuExtension.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
Binary file modified waifuExtension/.DS_Store
Binary file not shown.
46 changes: 46 additions & 0 deletions waifuExtension/Developer Support/BiasRecorder.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// BiasRecorder.swift
// waifuExtension
//
// Created by Vaida on 7/7/22.
//

import Foundation

struct BiasRecorder: Equatable {

let stage: Stage
let time: Double

static let biasQueue = DispatchQueue.global(qos: .background)

static var contents: [BiasRecorder] = []

static func add(bias: BiasRecorder) {
biasQueue.async {
contents.append(bias)
}
}

enum Stage: String, CaseIterable {
case initial0
case initial1
case initial2
case initial3
case prepare
case expend
case inPipe
case ml
case outPipe
case generateOutput
}

static var totalTime: Double {
contents.reduce(0) { $0 + $1.time }
}

static func bias(of stage: Stage) -> Double {
totalTime / contents.filter{ $0.stage == stage }.map(\.time).reduce(0, +)
}

}
9 changes: 9 additions & 0 deletions waifuExtension/Local/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
Localizable.strings
waifuExtension

Created by Vaida on 7/7/22.

*/

// no need, English is the development language
130 changes: 130 additions & 0 deletions waifuExtension/Local/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/*
Localizable.strings
waifuExtension

Created by Vaida on 7/7/22.

*/

// basic
"Done" = "完成";
"Cancel" = "取消";
"Show in Finder" = "在Finder中显示";
"Completed" = "完成";

// ContentView
"Drag files or folder." = "放入文件或文件夹";
"Cannot read this file" = "无法读取此文件";
"Remove All" = "去除所有图片";
"Remove all files." = "去除所有文件。";
"Show thumbnails as square or in full aspect ratio." = "以正方形或全宽高比显示缩略图。";
"Grid Item Count." = "网格项目的数量。";
"Set the size of each thumbnail." = "设置缩略图的大小。";
"Add Item" = "添加";
"Add another item." = "添加另一个项目";
"Begin processing." = "开始处理";


// ModelView
"anime" = "动画";
"photo" = "照片";
"none" = "无";
"Style:" = "样式:";
"anime: for illustrations or 2D images or CG\nphoto: for photos of real world or 3D images" = "动画: 画作或2D图片/CG\n照片: 现实照片或3D图片";
"Scale Level" = "放大倍数";
"Choose how much you want to scale." = "放大的倍数";
"Denoise Level:" = "降噪参数";
"denoise level 3 recommended." = "建议三倍降噪";

"Image Model:" = "处理照片的模型";
"Model Name:" = "模型名称";
"Enable TTA:" = "开启TTA";
"Enable video frame interpolation" = "开启视频补帧";
"Interpolation Model:" = "处理补帧的模型";
"Enable UHD" = "开启超高清";
"Frame Interpolation:" = "补帧倍率";
"Choose how many times more frames you want the video be." = "选择补帧倍率";
"Video segmentation:" = "视频切割";
"During processing, videos will be split into smaller ones, choose how long you want each smaller video be, in frames." = "在处理时,视频将被切割成小块,以减少内存使用。选择每个小块的长度,以帧为单位";
"Enable Parallel:" = "开启多核计算";
"Disable this to reduce processing speed in return for better memory performance." = "关闭以通过牺牲速度以换取更少的内存使用";
"Memory Only" = "仅使用内存";
"Use this option only if you are certain it is safe to keep all the intermediate images in the memory." = "仅在您确定把所有中间的图片存在内存里是安全的时开启";
"Return to previous page." = "回到上一页";
"Begin processing." = "开始处理";


// ProcessingView
"Loading..." = "加载中...";
"Loading.." = "加载中..";
"Finished" = "完成";
" in " = "位于";
"Processing" = "正在处理";
"images" = "张照片";

"Status:" = "状态";
"Progress:" = "进度";
"ML Model:" = "模型";
"Processed:" = "已处理";
"To be processed:" = "未处理";
"0 item" = "无项目";
"items" = "个项目";
"items" = "个项目";
"Time Spent:" = "过去时间";
"Time Remaining:" = "剩余时间";
"Paused" = "暂停";
"Calculating..." = "计算中...";

"Cancel and quit." = "取消并关闭软件";
"Resume" = "继续";
"Quit the app?" = "关闭软件?";
"Quit" = "关闭软件";

// welcome view
"Welcome to WaifuExtension!" = "欢迎来到WaifuExtension";
"(Optional) Please download the models and link them." = "(可选)请下载模型";
"Please keep your file in your disk, as WaifuExtension do not copy your file." = "请保重文件在你的设备上,本软件不会复制您的文件";
"Skip" = "跳过";

// welcome view grid item
"Download from Github" = "在Github上下载";
"Choose Model" = "选择模型";
"None was added" = "无项目被添加";
"Please drop in the folder containing the executable file." = "请放入一个含有可执行文件的文件夹";
"Cannot read " = "无法读取";
"Please move the model to somewhere else and retry (for example, your downloads folder)\nOtherwise, please ensure you can open the executable in Finder." = "请将模型移到其他地方,然后重试(例如,您的下载文件夹)\n否则,请确保您可以在Finder中可以打开这个可执行文件。";

// ConfigurationContainerView
"Configuration" = "设置";
"Models" = "模型";

// ConfigurationView
"Save Folder" = "保存的文件夹";
"Downloads/Waifu Output" = "下载/Waifu Output";
"Other..." = "其他...";
"Please choose a folder." = "请选择一个文件夹";
"Show Container" = "现实Container";
"Cache: " = "缓存: ";
"Empty" = "空";
"Delete Cache" = "清楚缓存";

// ModelManager
"Remove Model" = "去除模型";
"Update Model" = "更新模型";
"Show on Github" = "在Github上显示";
"Size: " = "大小";
"unknown" = "未知";
"Not Installed" = "未安装";

// MainModel
"Processing Images" = "处理照片";
"Processing videos" = "处理视频";
"Generating frames for %@" = "为%@处理帧";
"Converting frames to video for %@" = "为%@生成视频";
"Merging video with audio for %@" = "为%@合并视频音频";
"%@ Completed" = "%@ 处理完成";
"Generating audio for %@" = "为%@生成音频";
"Splitting videos for %@" = "为%@切割视频";
"Generating images for %@" = "为%@生成帧";
"Merging video for %@" = "为%@合并视频";

142 changes: 142 additions & 0 deletions waifuExtension/Local/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
Localizable.strings
waifuExtension

Created by Vaida on 7/7/22.

*/

// basic
"Done" = "完成";
"Cancel" = "取消";
"Show in Finder" = "在Finder中显示";
"Completed" = "完成";
"Pause" = "暂停";

"true" = "是";
"false" = "否";

// ContentView
"Drag files or folder." = "放入文件或文件夹";
"Cannot read this file" = "无法读取此文件";
"Remove All" = "去除所有图片";
"Remove all files." = "去除所有文件。";
"Show thumbnails as square or in full aspect ratio." = "以正方形或全宽高比显示缩略图。";
"Grid Item Count." = "网格项目的数量。";
"Set the size of each thumbnail." = "设置缩略图的大小。";
"Add Item" = "添加";
"Add another item." = "添加另一个项目";
"Begin processing." = "开始处理";


// ModelView
"anime" = "动画";
"photo" = "照片";
"none" = "无";
"Style:" = "样式";
"anime: for illustrations or 2D images or CG\nphoto: for photos of real world or 3D images" = "动画: 画作或2D图片/CG\n照片: 现实照片或3D图片";
"Scale Level" = "放大倍数";
"Choose how much you want to scale." = "放大的倍数";
"Denoise Level:" = "降噪参数";
"denoise level 3 recommended." = "建议三倍降噪";

"Image Model:" = "处理照片的模型";
"Model Name:" = "模型名称";
"Enable TTA:" = "开启TTA";
"In TTA mode, it takes 8 times of time to improve the image quality that is difficult to be detected by naked eye." = "在开启TTA后,软件会用更长的时间处理以增加画质。此效果不明显。";
"Enable video frame interpolation" = "开启视频补帧";
"Interpolation Model:" = "处理补帧的模型";
"Enable UHD:" = "开启超高清";
"Frame Interpolation:" = "补帧倍率";
"Choose how many times more frames you want the video be." = "选择补帧倍率";
"Video segmentation:" = "视频切割";
"During processing, videos will be split into smaller ones, choose how long you want each smaller video be, in frames." = "在处理时,视频将被切割成小块,以减少内存使用。选择每个小块的长度,以帧为单位";
"Enable Parallel" = "开启多核计算";
"Disable this to reduce processing speed in return for better memory performance." = "关闭以通过牺牲速度以换取更少的内存使用";
"Memory Only" = "仅使用内存";
"Use this option only if you are certain it is safe to keep all the intermediate images in the memory." = "仅在您确定把所有中间的图片存在内存里是安全的时开启";
"Return to previous page." = "回到上一页";
"Begin processing." = "开始处理";
"Please install models in Preferences" = "请在设置中安装模型";


// ProcessingView
"Loading..." = "加载中...";
"Loading.." = "加载中..";
"Finished" = "完成";
"Processing %@" = "正在处理%@";
"Processing %@ images in %@" = "正在处理%@张图片(位于%@)";
"Processing %@ images" = "正在处理%@张图片";

"Status:" = "状态";
"Progress:" = "进度";
"ML Model:" = "模型";
"Processed:" = "已处理";
"To be processed:" = "未处理";
"0 item" = "无项目";
"%@ items" = "%@个项目";
"%@ item" = "%@个项目";
"Time Spent:" = "过去时间";
"Time Remaining:" = "剩余时间";
"Paused" = "暂停";
"Calculating..." = "计算中...";
"ETA:" = "预计结束时间";

"Cancel and quit." = "取消并关闭软件";
"Resume" = "继续";
"Quit the app?" = "关闭软件?";
"Quit" = "关闭软件";

// welcome view
"Welcome to WaifuExtension!" = "欢迎来到WaifuExtension";
"(Optional) Please download the models and link them." = "(可选)请下载模型";
"Please keep your file in your disk, as WaifuExtension do not copy your file." = "请保重文件在你的设备上,本软件不会复制您的文件";
"Skip" = "跳过";

// welcome view grid item
"Download from Github" = "在Github上下载";
"Choose Model" = "选择模型";
"None was added" = "无项目被添加";
"Please drop in the folder containing the executable file." = "请放入一个含有可执行文件的文件夹";
"Cannot read %@" = "无法读取%@";
"Please move the model to somewhere else and retry (for example, your downloads folder)\nOtherwise, please ensure you can open the executable in Finder." = "请将模型移到其他地方,然后重试(例如,您的下载文件夹)\n否则,请确保您可以在Finder中可以打开这个可执行文件。";

// ConfigurationContainerView
"Config" = "设置";
"Inference" = "处理";
"Models" = "模型";

// ConfigurationView
"Save Folder" = "保存的文件夹";
"Downloads/Waifu Output" = "下载/Waifu Output";
"Other..." = "其他...";
"Please choose a folder." = "请选择一个文件夹";
"Show Container" = "现实Container";
"Cache: %@" = "缓存: %@";
"Cache: Empty" = "无缓存";
"Delete Cache" = "清楚缓存";

// Process Config View
"Video segmentation: %@ frames" = "视频分割大小: %@帧";

// ModelManager
"Remove Model" = "去除模型";
"Update Model" = "更新模型";
"Show on Github" = "在Github上显示";
"Size: %@" = "大小: %@";
"unknown" = "未知";
"Not Installed" = "未安装";
"Drop additional models here\nPlease keep your file in your disk, as executables are not copied." = "请将额外的模型拖拽到此\n请勿文件删除,文件将不会被复制至其他处。";

// MainModel
"Processing Images" = "处理照片";
"Processing videos" = "处理视频";
"Generating frames for %@" = "为%@处理帧";
"Converting frames to video for %@" = "为%@生成视频";
"Merging video with audio for %@" = "为%@合并视频音频";
"%@ Completed" = "%@ 处理完成";
"Generating audio for %@" = "为%@生成音频";
"Splitting videos for %@" = "为%@切割视频";
"Generating images for %@" = "为%@生成帧";
"Merging video for %@" = "为%@合并视频";

Loading

0 comments on commit db94901

Please sign in to comment.