mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 10:56:15 -08:00
feat: add Upscaler class for image and video upscaling with Web Workers
- Implemented methods for initializing the upscaling process, loading weights, and processing images and videos. - Added support for real-time video upscaling using OffscreenCanvas and Web Workers. - Included utility functions for loading image and video metadata, handling blob responses, and managing network configurations. - Introduced methods for downloading upscaled content and managing GPU capabilities. - Added error handling and progress tracking for the upscaling process.
This commit is contained in:
1 parent
17042867fc
commit
210eb94b75
23 files changed
+136717
-929
No files matched your search
@@ -7,10 +7,10 @@ var art = new Artplayer({
|
||||
fullscreenWeb: true,
|
||||
plugins: [
|
||||
artplayerPluginWebsr({
|
||||
scale: 2,
|
||||
networkSize: 'medium',
|
||||
weightsBaseUrl: '/assets/websr/weights',
|
||||
workerUrl: '/assets/websr/worker/main.js',
|
||||
compare: true,
|
||||
weights: "/assets/websr/cnn-2x-m-an.json",
|
||||
networkName: "anime4k/cnn-2x-m",
|
||||
}),
|
||||
],
|
||||
});
|
||||
@@ -1,13 +0,0 @@
|
||||
# Network Weights
|
||||
|
||||
There are 3 Anime4k networks implemented:
|
||||
|
||||
* [cnn-2x-s](https://github.com/bloc97/Anime4K/blob/master/glsl/Upscale/Anime4K_Upscale_CNN_x2_S.glsl)
|
||||
* [cnn-2x-m](https://github.com/bloc97/Anime4K/blob/master/glsl/Upscale/Anime4K_Upscale_CNN_x2_M.glsl)
|
||||
* [cnn-2x-l](https://github.com/bloc97/Anime4K/blob/master/glsl/Upscale/Anime4K_Upscale_CNN_x2_VL.glsl)
|
||||
|
||||
The original Anime4K network weights are stored in:`cnn-2x-s-an.json`, `cnn-2x-m-an.json` and `cnn-2x-l-an.json`.
|
||||
|
||||
I have also retrained the same networks for Real Life and 3D content (e.g. `cnn-2x-m-rl.json` for Real Life content, or `cnn-2x-m-3d.json`). These were trained on data from [Xiph](https://media.xiph.org/video/derf/), however the upscaling results qualitatively don't seem as good as Anime4K weights on animated content.
|
||||
|
||||
I will continue working on improving the networks and training strategy.
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-2x-l", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.010050178, 0.07514247, 0.113477625, -0.0050521293, 0.01478879, 0.09144898, -0.16916063, -0.0062370496, 0.006512118, -0.03930433, 0.021983238, -0.0565407, 0.0, 0.0, 0.0, 0.0, -0.04244692, 0.11679907, 0.16609213, -0.16842541, 0.07169264, 0.21394816, 0.08092494, -0.03002658, 0.035952974, 0.10141175, -0.32607806, 0.22579904, 0.0, 0.0, 0.0, 0.0, -0.11428862, 0.0039621624, 0.3454322, 0.056171715, 0.15070564, 0.06177961, -0.1525414, 0.060822755, 0.021606993, -0.018011494, -0.009556803, -0.02916302, 0.0, 0.0, 0.0, 0.0, 0.137314, 0.03353004, -0.12564452, -0.2032319, -0.18812643, 0.07161205, 0.0111773005, -0.048790902, 0.01887958, -0.14259052, 0.13026474, 0.15626068, 0.0, 0.0, 0.0, 0.0, 0.02319849, -0.39226383, -0.123694085, 0.22229607, -0.1712679, -0.26796553, -0.019221596, -0.006919385, -0.18473144, 0.006488457, 0.13326825, -0.08870392, 0.0, 0.0, 0.0, 0.0, -0.1269655, 0.08355754, 0.21463887, 0.097125545, 0.3017963, -0.08782909, 0.0050339396, 0.092567906, 0.01710076, 0.025207734, -0.2060725, 0.06790692, 0.0, 0.0, 0.0, 0.0, -0.00019268194, -0.030228717, -0.055018324, -0.082947895, -0.019216659, 0.046126038, 0.07169476, 0.052046675, 0.01451337, -0.026233962, 0.0025339196, 0.0070074038, 0.0, 0.0, 0.0, 0.0, 0.072528444, 0.19924125, -0.20110317, 0.07143661, -0.121316634, -0.15084448, -0.02568811, 0.06514408, 0.008883467, 0.033884615, 0.23646776, -0.22766043, 0.0, 0.0, 0.0, 0.0, -0.02415469, -0.042166796, -0.049360428, -0.12688674, -0.00039535295, 0.042400748, 0.067389965, 0.08709409, 0.027728926, 0.0324439, -0.046094008, -0.07646781, 0.0, 0.0, 0.0, 0.0], "bias": [-0.021017402, 0.023869233, -0.03446273, -0.017457444]}, "conv2d_tf1": {"name": "conv2d_tf1", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf1", "weights": [0.13039374, -0.20881647, 0.085535765, -0.04549321, -0.05602446, 0.05206936, -0.049312644, 0.058318272, -0.07205178, 0.12506376, -0.055328257, -0.040317576, 0.0, 0.0, 0.0, 0.0, 0.027084742, -0.046953436, 0.114328414, 0.019273244, -0.18612593, -0.042662013, -0.10632912, 0.46282503, 0.15413262, -0.11449919, 0.022248508, 0.14106302, 0.0, 0.0, 0.0, 0.0, 0.061211597, -0.09251022, -0.022290474, -0.026557192, -0.06401915, 0.04884669, -0.01012558, 0.0868072, 0.0051997304, 0.0016399457, 0.029869322, -0.06611751, 0.0, 0.0, 0.0, 0.0, 0.032391887, 0.1376006, -0.07514978, -0.011408214, -0.22705236, -0.060529344, -0.029770914, -0.016893994, -0.29513285, -0.15767653, 0.11569193, 0.0060723783, 0.0, 0.0, 0.0, 0.0, 0.23049706, -0.10150541, 0.3651725, 0.19905666, 0.2135744, 0.36350945, 0.25375202, -0.21457075, 0.054750398, -0.2203764, -0.10303004, 0.031399418, 0.0, 0.0, 0.0, 0.0, -0.20473221, 0.1794404, 0.14544463, -0.10519902, 0.13948862, -0.12484333, -0.057456728, 0.090331204, 0.06509677, 0.008269811, -0.058718067, -0.014385275, 0.0, 0.0, 0.0, 0.0, -0.09778942, -0.18738163, 0.102832824, -0.073642634, 0.0953312, 0.141663, -0.09108712, 0.072541974, -0.021894168, 0.06338371, -0.033460297, -0.003208068, 0.0, 0.0, 0.0, 0.0, -0.17743309, 0.22523694, 0.07015525, -0.04835906, 0.17053458, -0.18887468, -0.12807837, 0.052100822, 0.03275106, 0.18682368, 0.04089403, -0.012919293, 0.0, 0.0, 0.0, 0.0, 0.0072392495, 0.02001162, -0.030496176, -0.012241176, -0.079015754, -0.044929776, 0.0017619107, -0.018924208, 0.06333498, 0.101240695, 0.0061696167, 0.015617578, 0.0, 0.0, 0.0, 0.0], "bias": [0.003307056, 0.004167855, -0.04743373, -0.04461488]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf", "conv2d_tf1"], "output": "conv2d_1_tf", "weights": [-0.08246607, -0.06993787, 0.21518068, 0.09349072, 0.098292604, 0.0031368467, -0.06322315, 0.008967563, 0.014805354, -0.06916433, 0.08671435, 0.06909203, -0.084386684, 0.057038587, 0.059080295, 0.09245788, 0.12281746, -0.033948243, -0.099717066, -0.36737415, 0.013275642, -0.10866348, -0.08168493, -0.22546785, -0.093949944, -0.004218151, 0.13359737, 0.025002811, 0.016627438, 0.009715738, 0.065090775, -0.08140275, -0.16906688, -0.14757878, -0.033162065, -0.12727965, 0.19325337, -0.031597618, -0.085281275, -0.100973025, -0.030999115, -0.017681807, -0.013036884, -0.022147438, 0.09220687, 0.028913654, 0.10349628, 0.1713921, -0.107005164, 0.12082677, 0.043716736, -0.0060760453, 0.055586, -0.056089986, -0.23198368, 0.12206357, 0.10441252, 0.0066681965, -0.08183869, 0.021837998, 0.006353985, -0.065043665, -0.09902116, 0.007791685, -0.011813115, -0.30264404, -0.017419564, 0.29318118, 0.32588926, 0.15907557, -0.005746378, 0.5083059, -0.009286822, 0.02270092, 0.083120786, -0.12527227, -0.05032595, -0.044868883, 0.06349155, 0.019234573, -0.008378586, -0.12289949, 0.2454629, 0.06867388, 0.21918839, 0.10011607, -0.08913173, 0.2419772, -0.030028814, 0.015717681, 0.06962608, -0.08822798, -0.14691831, 0.03270783, -0.14878273, -0.07302588, 0.2680654, 0.08090772, -0.19636732, 0.29980376, -0.00057029625, -0.049441554, -0.0736Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-2x-l", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [0.3053028, -0.037464816, 0.113983095, 0.12537485, -0.18630321, 0.084269725, -0.01351514, -0.20190673, -0.12298384, -0.037622184, -0.070214555, -0.19367279, 0.0, 0.0, 0.0, 0.0, -0.41849324, 0.099702746, -0.04276645, -0.047299717, 0.20074473, 0.14217933, 0.15571699, 0.19553481, 0.21868695, -0.053848714, 0.016413521, 0.14117444, 0.0, 0.0, 0.0, 0.0, 0.030540446, -0.052293833, 0.0715466, -0.31160545, 0.07808315, -0.16860045, 0.032828577, -0.2955024, -0.110374965, 0.04043687, -0.014024628, 0.058699366, 0.0, 0.0, 0.0, 0.0, -0.10727635, 0.054200135, 0.20853694, 0.21086875, 0.122690216, -0.091823794, 0.310609, -0.01738923, -0.0013488946, 0.10835534, -0.077265196, 0.086751856, 0.0, 0.0, 0.0, 0.0, -0.77150255, 0.40530515, -0.41257596, -0.14367618, 0.46888494, 0.2650122, -0.934199, 0.40476102, 0.32293493, 0.20251967, 0.19891106, -0.29698747, 0.0, 0.0, 0.0, 0.0, -0.12505147, -0.41904053, -0.065798186, 0.34075752, 0.026240354, -0.2977496, 0.032647505, -0.003566783, 0.10290523, -0.23417123, -0.06014203, 0.094735645, 0.0, 0.0, 0.0, 0.0, 0.11207838, -0.04062474, 0.023897955, 0.08605987, -0.020888371, 0.045541205, -0.07231824, -0.25884083, -0.11796847, -0.002691391, 0.0050435597, 0.02756291, 0.0, 0.0, 0.0, 0.0, 0.4615728, 0.041790638, 0.08971143, 0.20213957, -0.38537467, 0.19938901, 0.08594364, -0.08621994, -0.08163473, -0.133266, -0.09561729, -0.014209637, 0.0, 0.0, 0.0, 0.0, 0.0787417, -0.0483673, 0.07621572, -0.060169693, -0.013465177, -0.17152289, 0.02515561, 0.17675288, -0.05173998, 0.10768042, -0.029858522, -0.013957215, 0.0, 0.0, 0.0, 0.0], "bias": [0.0072128535, -0.05658625, 0.052939568, -0.1760861]}, "conv2d_tf1": {"name": "conv2d_tf1", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf1", "weights": [-0.112743355, 0.0422517, 0.21350034, -0.0967133, 0.16265953, 0.0022497, 0.015078242, 0.08204187, 0.035236806, -0.0468228, -0.09464228, -0.001864949, 0.0, 0.0, 0.0, 0.0, 0.25631642, -0.41485596, -0.16662048, 0.13201024, 0.057921384, 0.2240005, -0.30038536, -0.08305622, 0.2228756, 0.32263795, 0.10608189, -0.18616734, 0.0, 0.0, 0.0, 0.0, 0.08997524, 0.11516871, 0.19212262, -0.035154644, 0.11612274, -0.04056247, 0.14974374, 0.029173585, -0.07629641, -0.14353512, 0.041081246, 0.20230265, 0.0, 0.0, 0.0, 0.0, 0.2262286, 0.055954933, -0.14499907, 0.17314723, 0.16590612, -0.06688698, -0.11118816, -0.012938116, -0.043101817, 0.026133137, 0.2958395, 0.06543993, 0.0, 0.0, 0.0, 0.0, -0.07311521, -0.3041244, -0.47978505, -0.6350967, -0.17432262, 0.34965977, 0.25399777, -0.16590433, -0.49957857, 0.0549526, -0.40869385, -0.08780993, 0.0, 0.0, 0.0, 0.0, -0.3014447, -0.00021343959, -0.14953177, 0.028001398, -0.14931908, -0.14910097, -0.13287953, -0.45026535, 0.17378895, 0.024704922, -0.027308129, -0.10292025, 0.0, 0.0, 0.0, 0.0, -0.06732655, -0.13119644, 0.066014715, 0.081011154, -0.15154321, 0.2407805, 0.07733481, 0.12312706, 0.1741804, 0.008495716, -0.14125362, -0.043644864, 0.0, 0.0, 0.0, 0.0, 0.11465958, 0.42001364, 0.011069392, 0.3203028, -0.058801666, -0.37830314, -0.030540617, 0.2245139, -0.11310525, -0.14845212, 0.19957744, 0.25789997, 0.0, 0.0, 0.0, 0.0, -0.16037206, 0.21326372, 0.020099448, 0.018666709, 0.122083254, -0.16033986, -0.10725163, 0.2556128, 0.1650688, -0.10475823, 0.048623525, -0.103755645, 0.0, 0.0, 0.0, 0.0], "bias": [0.007717166, -0.027800834, 0.0795002, 0.0053199283]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf", "conv2d_tf1"], "output": "conv2d_1_tf", "weights": [-0.0056740534, -0.21186607, -0.18014967, 0.118979976, -0.0015611284, -0.07708486, 0.060131397, 0.11653345, 0.027150517, 0.10837246, 0.08583816, -0.14032431, 0.017552888, 0.0035846964, 0.03980114, 0.064649396, -0.03289318, -0.12004539, 0.26514888, -0.15079662, 0.04214227, -0.027273783, -0.027950313, 0.19614808, 0.18510003, -0.10346252, -0.029836183, 0.09174428, -0.0088710375, -0.18273513, 0.06601674, 0.009983851, 0.08476211, 0.043996535, 0.056711517, 0.009976895, 0.07039107, -0.024862664, -0.059921104, 0.046850603, 0.04983447, 0.04863198, 0.21777405, -0.0576961, 0.045321796, -0.0060038245, 0.096396215, -0.10842004, -0.15746164, 0.041757874, 0.035169285, -0.1734288, -0.24219254, -0.13318908, 0.2272079, -0.02902605, 0.07750601, -0.1467191, -0.12296749, -0.07533314, -0.07073083, 0.17909113, 0.04789308, 0.17245363, 0.057547905, 0.1464685, -0.33115456, -0.26956198, -0.26298407, -0.059824817, 0.022509675, -0.09251868, 0.36277944, -0.2072429, 0.21095088, -0.45492023, 0.07428653, 0.1593302, -0.2945834, 0.12825087, -0.1318458, 0.27804148, 0.037600737, 0.12047866, 0.0065036337, 0.0017241207, 0.060497303, -0.14786585, -0.15149063, 0.02731698, 0.048886403, -0.0025970868, -0.026979815, 0.07348884, 0.015636757, -0.107966796, -0.079988025, -0.01626299, 0.06517438, 0.086406484, -0.1484504, 0.070595, 0.20620634, 0.09713373, -0.13620836, 0.012067949, -0.00068703433, -0.038Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-2x-l", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.012105739, -0.21161914, 0.08665858, -0.043757234, -0.004621963, 0.13140167, -0.020498553, 0.068226635, 0.0481979, 0.10644568, -0.073821716, -0.024450194, 0.0, 0.0, 0.0, 0.0, -0.03460033, -0.27414283, 0.1292829, 0.09952454, 0.08638587, 0.35136247, 0.002014225, -0.08911337, -0.04992038, -0.110431015, -0.27252296, -0.003830214, 0.0, 0.0, 0.0, 0.0, -0.0021824536, 0.021102726, -0.08147097, 0.044740677, -0.1426685, -0.08999886, 0.15422547, 0.033670772, 0.20571499, 0.09728407, -0.111735016, -0.06466725, 0.0, 0.0, 0.0, 0.0, 0.07400734, 0.085574634, -0.04571311, 0.2248693, 0.10583874, 0.086663984, 0.024795951, -0.35407907, -0.26252225, -0.18206589, -0.24463207, 0.04226849, 0.0, 0.0, 0.0, 0.0, 0.17383823, 0.2746202, -0.032821946, 0.103890546, -0.06658831, 0.05487442, 0.16287333, 0.49353996, -0.16454698, -0.35587335, 0.16858181, -0.08336467, 0.0, 0.0, 0.0, 0.0, 0.040836602, -0.38409352, 0.15976837, -0.43389916, -0.12867598, 0.08438891, -0.23420188, 0.14995688, 0.30413496, 0.35525417, 0.07781118, 0.13279356, 0.0, 0.0, 0.0, 0.0, 0.15095623, -0.024260975, -0.202878, 0.075513266, -0.09152621, 0.022201281, 0.08690367, -0.1823229, -0.08408583, 0.018264614, 0.11019093, -0.023587493, 0.0, 0.0, 0.0, 0.0, -0.4175719, 0.33386105, 0.125944, -0.22175133, 0.24887371, -0.49503592, -0.2636298, -0.059413243, -0.055216774, 0.17881532, 0.21107183, 0.04566585, 0.0, 0.0, 0.0, 0.0, 0.026185002, 0.19325988, -0.12736501, 0.088774204, -0.06482355, -0.14696772, 0.09635952, -0.10223607, 0.11916547, -0.118482724, 0.07763682, -0.002604218, 0.0, 0.0, 0.0, 0.0], "bias": [-0.011822983, 0.014293483, -0.012769984, -0.006732855]}, "conv2d_tf1": {"name": "conv2d_tf1", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf1", "weights": [0.28916284, -0.15040879, -0.0192073, -0.02884963, -0.21905234, 0.10878694, 0.011726894, -0.0068682986, -0.036941536, 0.044427305, 0.01452491, 0.071234636, 0.0, 0.0, 0.0, 0.0, -0.06996328, 0.20391136, 0.003351214, 0.059514046, -0.1084377, -0.028712979, -0.020189134, -0.026048189, 0.2243152, -0.11857627, 0.01867051, 0.011538576, 0.0, 0.0, 0.0, 0.0, -0.06152791, 0.48313802, -0.027256152, 0.040346023, -0.059589285, -0.45092732, 0.031973995, 0.0014718119, 0.0718745, 0.1250955, -0.009234695, -0.02332268, 0.0, 0.0, 0.0, 0.0, -0.0079591675, -0.043386262, -0.00452483, 0.08524179, 0.2201916, 0.042028118, 0.04982621, 0.021659052, -0.2251324, -0.046369746, -0.037215274, -0.09933687, 0.0, 0.0, 0.0, 0.0, -0.019172274, -0.43990272, -0.014577412, -0.13917908, -0.174285, 0.11088744, -0.047036733, -0.6268773, 0.16506457, 0.1510162, 0.03264733, -0.13022646, 0.0, 0.0, 0.0, 0.0, -0.19903474, -0.015057147, -0.3485079, -0.037082385, 0.19506766, 0.30837542, 0.051440038, 0.0045731016, -0.040234413, -0.27285996, -0.03142853, 0.078196004, 0.0, 0.0, 0.0, 0.0, -0.06812288, -0.01902635, -0.028367367, -0.015901025, 0.25828847, 0.08126227, -0.015662927, -0.029707028, -0.12541315, -0.07381142, 0.054435838, 0.08023881, 0.0, 0.0, 0.0, 0.0, 0.2385132, -0.16228026, 0.025715888, 0.012847345, 0.016879985, 0.06565064, 0.028275423, 0.010252947, -0.23852967, 0.09502917, -0.04704847, -0.005720649, 0.0, 0.0, 0.0, 0.0, -0.06551658, 0.14412688, -0.0531433, 0.04537602, -0.0037525722, -0.22331794, 0.02733627, -0.0102778, 0.014737596, 0.06094958, 0.026655352, -0.023332475, 0.0, 0.0, 0.0, 0.0], "bias": [-0.020497546, -0.007860721, 0.030287042, 0.028565682]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf", "conv2d_tf1"], "output": "conv2d_1_tf", "weights": [-0.010358707, 0.0490416, -0.10518602, 0.06427084, -0.0034192111, 0.013586318, 0.06833705, -0.0557498, 0.035131715, 0.03363387, -0.038138706, 0.07597535, -0.025302604, 0.0047035823, 0.10352301, -0.056792695, -0.116226494, -0.012450746, 0.28944185, -0.03426505, 0.012647472, -0.0021045296, -0.028492844, 0.19581257, -0.1482818, -0.018367179, 0.120634414, 0.11839382, 0.01900549, -0.045902513, 0.42492622, 0.04239026, 0.2232401, 0.03416393, 0.060350582, -0.109450236, -0.15116562, 0.01000294, 0.005642412, 0.13348213, -0.022755088, 0.11170208, -0.038675003, 0.1340381, 0.1046923, 0.027725171, 0.2022053, 0.024041511, 0.05565773, -0.0020359703, -0.083414115, 0.098895594, 0.02194162, -0.01768254, 0.08173551, 0.09919405, 0.15445028, -0.03146529, -0.081083044, 0.10636767, -0.042560574, 0.07268869, 0.22148202, 0.19362788, -0.12083246, 0.10130491, -0.081338964, 0.27768773, 0.15600735, 0.053578418, 0.0073994165, -0.30713353, -0.18364441, -0.11660445, -0.2128906, 0.321189, 0.04764897, -0.027210085, -0.22743653, 0.07671181, 0.09754845, -0.056604456, 0.024920316, -0.09915068, -0.16163763, 0.033750433, -0.05144461, -0.06408046, 0.09309471, 0.11419357, 0.30810606, -0.25331327, 0.13132183, 0.21047948, 0.28078455, 0.17718777, -0.009033929, 0.010669166, -0.10706134, 0.21554418, 0.009046256, -0.0014486881, 0.041525267, 0.17218027, -0.04988403, 0.00452Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-2x-m", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.11606336, 0.17977928, -0.27346742, 0.124493435, 0.15652506, 0.2845143, -0.0026843916, -0.19497222, 0.13320322, 0.11033785, -0.21989621, 0.11207873, 0.0, 0.0, 0.0, 0.0, -0.10988178, -0.30772716, -0.41737673, 0.09727902, -0.23669402, -0.5062192, -0.2662598, 0.1126543, -0.110433154, -0.035403367, -0.27922922, 0.014905251, 0.0, 0.0, 0.0, 0.0, 0.1673138, 0.21435647, 0.0991883, 0.08848872, 0.28353062, -0.22595239, 0.22235885, -0.12553884, -0.06435851, 0.23793034, -0.02895988, 0.05851421, 0.0, 0.0, 0.0, 0.0, -0.06527518, 0.0009992365, 0.16914415, -0.08580268, -0.065111995, 0.18426816, 0.33551374, -0.05623329, -0.34856713, 0.055840224, 0.10477855, 0.3088062, 0.0, 0.0, 0.0, 0.0, -0.4047918, -0.38514897, 0.6453525, -0.6695825, -0.4114409, -0.27396202, 0.58474267, 0.25724518, -0.3791753, -0.30253774, 0.19307339, -0.30811906, 0.0, 0.0, 0.0, 0.0, -0.05841689, 0.12711738, -0.26518336, -0.21317536, -0.052410815, 0.16059583, -0.05319537, 0.01622084, 0.07479186, -0.30965877, 0.2144306, 0.15355839, 0.0, 0.0, 0.0, 0.0, 0.14847465, 0.13815038, -0.028073678, 0.2186973, -0.18746363, -0.19688894, -0.21375322, -0.029839175, 0.31318492, 0.03398371, 0.13908163, -0.17011626, 0.0, 0.0, 0.0, 0.0, 0.082191214, -0.07573231, -0.110015325, 0.044385966, -0.09126862, 0.50149125, -0.36304137, -0.31671065, -0.0760504, 0.19005129, 0.29838115, -0.06994295, 0.0, 0.0, 0.0, 0.0, -0.03997613, 0.10711133, 0.2920969, 0.17430729, -0.08918032, 0.09155168, 0.013416766, 0.027657839, 0.19027728, 0.020657036, -0.33332226, -0.22530448, 0.0, 0.0, 0.0, 0.0], "bias": [0.07606802, 0.09729832, 0.012942811, 0.5625359]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf"], "output": "conv2d_1_tf", "weights": [0.13398904, 0.31106707, -0.24516815, -0.10223475, -0.021094762, 0.06421805, 0.20445661, 0.017145015, -0.09517393, 0.030834226, 0.11247594, -0.009866822, -0.02299197, -0.0025018842, 0.078243144, -0.09684197, 0.26788697, 0.2721901, -0.16956545, 0.46711928, -0.06078478, 0.2121688, -0.10680213, -0.12403891, -0.12835354, -0.1414604, 0.2116623, 0.06955634, 0.030484539, 0.03776486, 0.062162813, 0.09124468, 0.015129639, 0.19659676, -0.43855304, 0.052361038, -0.12687272, -0.07380384, -0.04636695, 0.117407836, 0.08115984, -0.10018457, 0.06883005, -0.018031513, -0.03776163, -0.0367366, -0.07437988, -0.053009566, 0.17695092, 0.014332625, 0.002966589, -0.19727035, 0.08600045, 0.06847765, -0.14117013, -0.014638577, -0.14032821, -0.031005614, 0.14726682, 0.022833185, -0.015553153, 0.11482301, -0.002867386, -0.0039069876, -0.25406557, -0.115356736, 0.101271845, 0.33151704, 0.32322282, 0.040061504, -0.062065504, 0.115033105, -0.0933092, -0.10633967, -0.19852228, -0.18449658, 0.022037001, -0.19889763, 0.064308524, 0.10046037, 0.18254162, 0.32357463, 0.4288217, 0.6237335, -0.11840234, -0.0071857166, -0.08804538, -0.07589813, 0.15188785, -0.010205552, -0.09852454, -0.2460295, -0.07461511, -0.032564312, -0.27323446, -0.064379774, 0.044581793, 0.22894746, -0.1802935, -0.2690704, 0.079360805, 0.103287585, -0.008570362, -0.089542575, -0.1329516, 0.12050982, -0.0030015386, -0.027521424, 0.051165797, -0.10085252, 0.00013368498, 0.073774755, -0.40903112, -0.12125079, 0.298725, 0.036986463, 0.120306335, -0.17919756, -0.06324796, 0.28444302, 0.32893908, -0.08780014, -0.11230092, 0.20419864, -0.1681612, 0.16062817, -0.0123456055, -0.208336, -0.20350553, 0.22378701, 0.009587118, -0.10072582, 0.050127126, -0.037878074, -0.03381747, -0.021997068, 0.15292531, -0.010497088, 0.0758131, -0.056700535, 0.07834409, -0.10942698, 0.055824224, 0.12815832, -0.17698693, -0.3055658, 0.09967433, 0.098928824, 0.10173185, 0.04113592, -0.29084405, -0.024333095, 0.06813831, 0.053886253, 0.03601129, 0.01787395, -0.3636861, -0.2611388, 0.42422765, -0.27144617, -0.17313176, -0.094153084, -0.0032488997, -0.26813602, 0.20981374, -0.12566373, 0.09031148, 0.15152319, 0.024084533, 0.1122652, 0.012085819, -0.018394787, -0.03474743, -0.30334213, 0.17162411, -0.34010682, 0.10829615, -0.058659215, 0.096897066, -0.075050645, -0.04252922, 0.065123, 0.07876711, -0.14319685, -0.06574127, 0.05299319, -0.21848576, 0.05696007, -0.22319631, 0.02581564, 0.09025793, -0.12129464, 0.04095923, -0.07435875, 0.051763527, 0.072874926, 0.047589038, -0.12897262, 0.17409727, 0.0333813, 0.18284716, 0.20985128, -0.1333369, -0.045197096, -0.14864855, -0.6198857, 0.50725585, 0.1453008, 0.08633372, 0.041169077, -0.113290854, -0.119742654, 0.16737501, 0.17155202, 0.14582264, -0.28672713, 0.49221733, -0.1012341, 0.41467783, -0.036201924, -0.57681143, -0.5296542, -0.40910345, 0.6782604, -0.30978954, -0.036785055, -0.24596226, -0.17083214, 0.030971462, 0.010830634, 0.0026806833, 0.14230551, -0.11693772, 0.046302274, 0.4059211, 0.2792543, 0.15723385, -0.5630804, -0.6161421, 0.2024145, 0.21252708, -0.10771148, 0.036381878, 0.16049491, 0.05679561, -0.044410653, -0.0629642Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-2x-m", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.072145514, 0.00028308097, -0.02246936, 0.024812723, -0.07055249, -0.026193684, 0.06250765, 0.10273287, 0.023989726, 0.059850752, 0.12388443, -0.05610249, 0.0, 0.0, 0.0, 0.0, 0.09287214, -0.28751278, 0.16856873, -0.15185986, 0.16519044, 0.4119165, 0.07745975, -0.39149612, 0.13748379, 0.19694383, -0.0066408464, 0.035648603, 0.0, 0.0, 0.0, 0.0, 0.046672463, -8.82265e-05, 0.15009816, 0.102355726, -0.032501314, -0.14876123, -0.1941357, 0.11521068, -0.032267876, 0.14113747, -0.07084842, -0.08086943, 0.0, 0.0, 0.0, 0.0, -0.03968421, -0.19019222, -0.07080888, -0.12406084, 0.122626044, 0.15815943, 0.1530841, 0.06688442, 0.1656277, 0.09434839, 0.026673744, 0.030796751, 0.0, 0.0, 0.0, 0.0, 0.6921126, 0.095474385, -0.0056551266, 0.05798976, 0.7254942, -0.2543809, -1.0393281, -1.035846, -0.08110214, -0.6830166, -0.15731563, 0.39509445, 0.0, 0.0, 0.0, 0.0, -0.13021441, 0.1503607, 0.20657627, -0.0663681, 0.033763044, -0.066993274, 0.6008725, -0.1464296, -0.06528626, 0.09392874, 0.061711833, -0.069615036, 0.0, 0.0, 0.0, 0.0, -0.30076998, -0.14036414, -0.16433552, -0.08016163, 0.10318603, -0.03843068, -0.09866994, 0.14631474, 0.05388223, 0.034318227, 0.052106798, -0.057668205, 0.0, 0.0, 0.0, 0.0, -0.23786129, 0.3727822, -0.36011657, 0.047483545, 0.055704113, -0.20353787, 0.08237646, 0.17585282, -0.02251169, -0.10484316, 0.027232561, -0.13464582, 0.0, 0.0, 0.0, 0.0, 0.108914025, 0.02642652, 0.107908495, 0.118661806, -0.051034376, 0.0048822667, 0.10991195, 0.08074561, -0.067566656, 0.070840575, -0.04906773, -0.116966926, 0.0, 0.0, 0.0, 0.0], "bias": [-0.2894205, -0.030624738, 0.3073097, 0.16633725]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf"], "output": "conv2d_1_tf", "weights": [0.06147661, 0.08833126, 0.046938453, -0.06018922, 0.018930146, 0.17391251, 0.0968089, 0.16006882, 0.046476644, -0.120067514, 0.00928321, -0.1123082, 0.09198358, -0.113103606, 0.09203268, 0.10243458, 0.03423173, 0.2505715, 0.031599615, -0.09511331, 0.1426214, -0.15313806, 0.12848975, 0.023286961, 0.11289028, -0.08757947, -0.43745708, 0.06928223, 0.3181391, 0.057651803, 0.026929406, 0.03803578, -0.1292945, 0.042583257, -0.2004356, 0.32660207, 0.1276197, -0.056887686, -0.24774489, -0.13177316, -0.081318446, -0.06493321, -0.07007088, -0.055146568, -0.023784764, 0.11433824, -0.3040935, -0.027778838, -0.044498716, 0.42280948, 0.062070623, 0.2148611, -0.123194054, -0.25048327, 0.19733655, -0.13551375, -0.009461302, -0.5631941, -0.08607164, 0.13850448, -0.08990211, -0.14915596, -0.066133216, -0.19829673, 0.21967943, -0.25121883, 0.37952, -0.45724368, -0.2076556, -0.28931007, 0.3471786, 0.122488834, -0.012703499, 0.31451723, 0.21664213, 0.21074998, 0.3702994, 0.15678592, -0.21367137, 0.8268485, -0.22125253, -0.110753976, 0.047768846, -0.27023393, 0.13471258, 0.14345424, -0.13693272, 0.038446166, -0.06620079, -0.05445717, 0.039801225, -0.046015315, 0.11203161, 0.26460502, -0.023194747, -0.039629303, 0.069432564, -0.09272574, 0.12253827, 0.1291694, -0.11224104, 0.16809909, -0.06915314, -0.17369248, 0.05969406, -0.14640228, -0.0057935934, -0.08471993, -0.02034365, 0.29337114, 0.14110939, 0.0361152, -0.27787417, 0.009200061, -0.08835913, -0.056134365, -0.21587728, 0.21017273, -0.31632778, -0.25002062, 0.29224077, 0.40650958, 0.1681141, -0.23782323, -0.16064619, -0.19453338, -0.34186718, -0.053081196, -0.24282049, -0.11873012, -0.11440592, -0.008417438, -0.034035943, -0.18256468, -0.16165936, 0.03052503, -0.08246184, 0.06311742, 0.04626973, 0.040066913, -0.10866987, -0.04512457, 0.09514122, 0.038252804, -0.03537035, -0.13365282, 0.0019187316, 0.039242424, -0.06117977, -0.092283174, -0.13210632, -0.17939499, -0.066161625, 0.13690484, -0.005225468, 0.2245015, -0.13621947, -0.026488775, -0.050598588, -0.14804119, -0.107831135, -0.22277409, -0.02657944, -0.038208194, -0.24297678, -0.018400285, -0.26537237, 0.022952996, -0.10555939, 0.261099, 0.43923762, -0.013036105, -0.28890732, -0.0063598123, 0.025646267, -0.013443436, 0.054750264, -0.016597766, 0.32688782, -0.2769158, -0.09020083, 0.04267472, 0.2602852, 0.08283018, 0.043695193, 0.0037251178, 0.006281472, 0.05668816, -0.030066907, 0.055234175, 0.2986416, 0.16619839, 0.018525071, -0.4757674, 0.04003113, -0.41883922, 0.107983075, 0.1751906, -0.17759812, 0.08198361, -0.10118877, 0.56437653, -0.010495897, -0.0020253563, 0.08937133, 0.17738473, -0.02704055, -0.24398229, 0.080102555, 0.47490886, -0.8159124, 0.7260771, 0.37928665, 0.037219018, -0.15212315, -0.2146389, -0.2708812, -0.45721346, 0.01860179, -0.1548227, 0.107198894, -0.03666022, -0.46162957, -0.20030443, 0.11108713, 0.063587174, -0.20645106, 0.35211852, -0.024195202, -0.13010001, 0.14576577, -0.11711316, 0.030958494, 0.065396935, 0.0071226587, 0.016234476, -0.18657097, -0.24682587, 0.20031837, 0.061695997, -0.10664103, 0.21913692, -0.01698097, -0.096373215, 0.07363686, -Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-2x-m", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.43700448, -0.12383181, -0.39803663, 0.52009004, -0.42380998, 0.07342348, -0.10417725, -0.1929202, -0.20059313, 0.08596013, -0.036150236, 0.1943204, 0.0, 0.0, 0.0, 0.0, 0.5285974, -0.14970095, 0.21255529, 0.36134776, -0.0778857, 0.061038077, 0.24571013, -0.06840865, 0.06106429, -0.06369855, 0.17126374, -0.025089366, 0.0, 0.0, 0.0, 0.0, -0.0073111467, 0.15535195, -0.089282654, -0.165693, -0.13300648, -0.0011212918, 0.15022895, 0.20636183, 0.09242716, -0.026319012, -0.21280405, -0.024262758, 0.0, 0.0, 0.0, 0.0, 0.1622117, -0.07452305, 0.27938735, 0.14650205, 0.18462916, 0.1800196, -0.23781396, -0.31704575, 0.17726475, -0.07114437, -0.091533884, -0.14328986, 0.0, 0.0, 0.0, 0.0, -0.42393574, -0.15274704, 0.32710415, -0.6862922, 0.4688005, -0.6634383, 0.66417086, 0.1555097, -0.02981386, -0.2933985, 0.33087853, 0.11909872, 0.0, 0.0, 0.0, 0.0, 0.33267993, -0.15994301, -0.26408252, -0.086990856, -0.22168767, 0.26116654, 0.22150806, 0.09417441, -0.0658948, 0.10053972, 0.27021578, -0.026661402, 0.0, 0.0, 0.0, 0.0, 0.16740121, 0.1931361, 0.20080176, 0.01869556, -0.11620115, -0.30608, -0.22552842, 0.0681357, 0.0069506024, 0.052228536, 0.24273908, -0.07155123, 0.0, 0.0, 0.0, 0.0, -0.18680367, 0.08907917, 0.13614553, 0.024371676, 0.14730337, -0.23263486, -0.33878776, -0.29022864, -0.14831644, 0.088786215, -0.21803996, -0.05703613, 0.0, 0.0, 0.0, 0.0, -0.14036681, 0.03581416, -0.11044763, -0.19030686, 0.1583473, 0.34034556, 0.097776145, 0.28929195, 0.10333786, 0.0068274974, -0.2546084, 0.011477104, 0.0, 0.0, 0.0, 0.0], "bias": [-0.049156994, 0.0032814543, -0.021223499, 0.04594601]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf"], "output": "conv2d_1_tf", "weights": [-0.084388204, -0.03754589, -0.03338206, -0.022792505, -0.11356078, -0.076055825, -0.116272084, 0.009878847, 0.050765485, -0.016359871, -0.0662348, -0.029309144, -0.0333739, -0.036814813, -0.051065993, -0.12447015, 0.14584453, -0.043335147, -0.14875184, -0.2461169, 0.34755084, 0.15603498, 0.12930207, -0.25289717, -0.09891424, 0.18705226, 0.29315478, 0.17761377, 0.35723284, 0.058198802, -0.058125, -0.021009078, -0.111764, 0.09134145, 0.21115285, 0.100136325, -0.072855465, 0.15357259, 0.15194869, 0.0178175, 0.09330566, -0.098077565, 0.038239785, 0.059173394, -0.068434745, 0.045846846, -0.17534588, 0.07933592, -0.066422224, 0.022894884, -0.07700093, 0.08097129, -0.14496642, -0.14080046, 0.11690855, -0.0130255865, 0.08388152, -0.04426715, 0.07650244, -0.08116129, 0.053052384, 0.016861709, -0.07543915, -0.06905064, -0.21035792, -0.105432585, -0.0056535043, -0.23794414, 0.48689848, 0.31393805, 0.3530186, -0.19768368, -0.1997345, -0.26513356, -0.18177964, -0.039847106, -0.21796939, -0.21797366, -0.014920429, -0.03402468, 0.22454734, -0.2740147, 0.37796697, 0.4131328, 0.17031397, -0.2167817, -0.18882456, -0.06301378, 0.09259609, 0.14579444, -0.1731323, -0.2815266, -0.09086814, 0.22318031, 0.13372593, -0.0059168623, -0.041474655, 0.049808305, 0.070003934, 0.07624304, -0.20659865, 0.11079161, -0.14937906, 0.04126273, 0.08142401, -0.07068922, -0.020291204, -0.017090015, -0.025190167, -0.013943749, 0.049148437, -0.0019008453, 0.026148785, 0.2774172, 0.040490817, 0.08888442, -0.0321537, -0.010025804, 0.29734322, 0.059648763, -0.06863294, 0.02136135, 0.08915012, -0.1493992, -0.14656575, 0.07361045, -0.0784827, 0.20458257, 0.013372844, 0.2095454, 0.28334874, -0.17267562, 0.049244374, 0.09788063, -0.12814337, -0.18134497, -0.057618555, 0.17491128, -0.16961642, -0.10532874, -0.05132699, -0.11516367, 0.057307858, 0.3841081, -0.012563992, -0.005472043, 0.012879804, 0.048063014, -0.46123943, 0.23493885, 0.030362573, -0.16059463, -0.007925698, 0.084083386, -0.02318799, -0.0648104, -0.013350591, 0.080370896, -0.015556411, 0.109980844, -0.12998067, 0.069770575, 0.13883549, 0.21138588, -0.05804825, -0.21146816, 0.3263755, 0.21483842, 0.023421993, -0.20007822, -0.29615954, -0.15914749, -0.09120564, -0.120906316, 0.016582696, 0.081140004, 0.05719205, -0.11219546, -0.09251098, -0.047495708, -0.0054177176, -0.18277131, -0.19931898, -0.026179295, -0.259792, 0.12538151, 0.12978444, -0.084640495, 0.075031735, 0.038247548, -0.018510683, -0.13305412, -0.02436355, -0.018553583, 0.07399168, -0.051803768, -0.027177656, 0.19410136, -0.007979428, 0.03406536, 0.037885316, 0.04339598, -0.017780855, 0.1151958, -0.08222779, -0.05242254, 0.09643237, 0.10336347, 0.0150745055, -0.10105735, 0.15461528, 0.15281117, -0.31552103, -0.24329075, -0.044556107, -0.045301564, 0.47285315, 0.13444383, 0.05405222, -0.008511255, -0.102524556, 0.002268493, 0.0722259, -0.168346, -0.20540647, 0.09040869, 0.00019255982, -0.2921076, 0.06381097, 0.2187697, -0.0608732, 0.012592055, -0.12938985, -0.20120203, 0.34224886, 0.37817004, 0.039558195, -0.1321521, -0.09888887, -0.1906491, 0.04147559, -0.06910313, -0.05176795, 0.031068431, 0.055590235Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-2x-s", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.0022612927, 0.056973718, -0.018455653, 0.14739583, -0.122750364, 0.23741247, 0.15598795, 0.05692804, 0.18175821, 0.13481095, -0.08827108, 0.05554242, 0.0, 0.0, 0.0, 0.0, 0.04206811, 0.23834495, 0.13003352, -0.077002496, 0.17685443, -0.20654015, 0.06842113, 0.2903542, -0.26250055, 0.13811174, 0.26133212, -0.02114791, 0.0, 0.0, 0.0, 0.0, 0.093419984, -0.07030613, 0.29529554, -0.04851454, -0.18972242, 0.14136502, -0.04747689, -0.06364426, 0.22331561, -0.10553665, 0.16183273, 0.05455794, 0.0, 0.0, 0.0, 0.0, 0.24077286, 0.23530032, -0.058636595, -0.37148198, -0.06763021, 0.3874437, 0.15182178, -0.5923735, -0.13545403, 0.15376179, 0.21833488, -0.2147259, 0.0, 0.0, 0.0, 0.0, -0.2060378, 0.20107107, -0.57699513, 0.17214543, 0.26857927, 0.21768239, -0.54763824, 0.022310967, 0.24290903, 0.0074973702, -0.73197544, 0.16953811, 0.0, 0.0, 0.0, 0.0, -0.53420544, -0.09096746, -0.25905782, 0.13050057, -0.21312474, -0.046465185, -0.19382372, -0.079869874, -0.48216957, 0.036481928, -0.2352641, -0.059043337, 0.0, 0.0, 0.0, 0.0, -0.030450007, -0.10884538, 0.18111393, -0.1775848, 0.27219498, -0.09239544, -0.026854752, -0.14357966, -0.1850866, 0.1308016, 0.028251573, -0.21514907, 0.0, 0.0, 0.0, 0.0, -0.10568889, 0.15597937, 0.27339727, 0.0804553, 0.04280254, -0.08279245, 0.20513073, 0.055260282, 0.31278867, -0.24821152, 0.29145843, 0.10567111, 0.0, 0.0, 0.0, 0.0, 0.25927135, -0.16821514, 0.005973275, -0.11551916, -0.49868804, 0.103718266, 0.1801412, 0.06371136, -0.06251711, 0.058491655, 0.08287211, -0.04250653, 0.0, 0.0, 0.0, 0.0], "bias": [0.42747816, -0.50199944, -0.008679179, 0.002979711]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf"], "output": "conv2d_1_tf", "weights": [0.14501162, 0.08745608, 0.047154814, 0.11138436, -0.030867573, -0.0009166872, 0.055052515, -0.12617113, -0.104578145, 0.0068466533, 0.013762538, 0.111968696, 0.07529147, 0.006874992, 0.15803319, 0.19343081, 0.10959786, -0.057358194, 0.061577655, -0.008993094, 0.048110843, -0.0864788, 0.01113672, -0.22644496, -0.12960532, 0.030239241, -0.08421794, -0.13423525, -0.07145387, 0.044097863, 0.009972901, 0.04685787, -0.023261277, 0.03164763, 0.028907845, -0.0102096815, 0.1474105, -0.03114013, 0.15159902, -0.086211964, 0.04718239, 0.0018872966, 0.03155034, 0.028671373, 0.08148231, 0.17568494, 0.047075186, 0.34778616, 0.036335807, -0.094797246, -0.4159549, 0.24694933, 0.24209529, -0.07121227, 0.1532561, 0.3843501, -0.07694775, 0.19775048, -0.32267457, -0.09720791, 0.020951513, -0.09151028, 0.3170201, 0.1605608, -0.07707157, 0.043557756, 0.05671068, -0.01463445, -0.26492572, 0.18719704, -0.095243685, 0.4080296, 0.41637594, 0.11404859, -0.033315994, 0.066214, 0.021033298, 0.18487465, -0.18571156, -0.54635674, 0.068084195, -0.096393734, 0.0035257551, 0.012287477, -0.07196971, 0.025817184, -0.07986198, 0.07784954, -0.16452111, 0.031261202, 0.023056887, -0.0522975, -0.009634468, -0.31535807, -0.12919909, 0.033792194, 0.10813535, -0.05337902, 0.06076626, 0.07202521, 0.09736061, -0.08541826, -0.027104156, 0.10542381, -0.005607362, -0.11555167, 0.14021239, 0.18931355, -0.017547207, -0.108811274, -0.03125718, 0.14564131, -0.1093017, 0.013502633, 0.018116413, 0.018391598, -0.18378423, -0.401403, 0.012552945, 0.15719055, -0.0228895, 0.02655741, -0.043465126, -0.044321306, 0.23494045, -0.15205893, 0.18678686, 0.3955797, -0.02278326, 0.039361916, 0.011373453, 0.013933539, 0.11071886, 0.11702748, -0.12705022, 0.19540352, -0.07263767, 0.041922275, 0.009229501, 0.024164628, 0.10296556, 0.16725765, -0.0818962, -0.0047961213, 0.29457232, 0.13599043, -0.008714703, -0.16847761, 0.040908597, -0.04422869, 0.011877597, 0.075768694, 0.14954948, 0.040835135, 0.0846475, -0.22214502, -0.056186993, 0.0638945, -0.0042281435, -0.23239982, -0.06668496, 0.1756623, 0.007815604, -0.25763178, -0.04470249, 0.06488682, 0.028682206, 0.16186592, -0.011941624, -0.06400568, 0.10282864, 0.039630037, 0.19423516, -0.031500183, 0.106168106, 0.036937393, 0.09141408, -0.010553094, 0.1342473, -0.043508966, -0.17903467, 0.08791904, -0.036400225, 0.028037839, -0.029616812, -0.026422223, -0.022944598, -0.010333497, -0.031189896, 0.03240508, -0.0785576, 0.015098909, -0.041526146, 0.26786005, -0.46808454, -0.22427405, -0.22540379, 0.1254596, 0.08504417, -0.4350252, 0.008509114, -0.11203634, -0.26448494, 0.08993352, -0.06692775, 0.0062625394, -0.1925751, -0.19362088, 0.018179841, -0.05096496, 0.0597967, -0.05776889, 0.035965182, -0.065931715, -0.37168455, -0.10637159, -0.23258503, 0.09219399, 0.12451923, -0.04139515, 0.11661162, -0.40143165, -0.19453132, 0.16580793, -0.12704377, -0.058811054, -0.030635664, 0.040619805, 0.18785484, 0.019730633, 0.0033181638, 0.03790057, 0.073501006, 0.006731647, 0.028191924, -0.010616595, -0.29848912, 0.10158166, 0.059347004, 0.0060802675, -0.15607527, 0.13109104, 0.11584357, -0.20041798, -0.08759147,Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-2x-s", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.0057322932, 0.12928207, -0.056848746, 0.18680117, -0.0306273, 0.25602463, 0.053723164, 0.20419341, 0.0018709862, 0.022848232, -0.04105527, 0.10169034, 0.0, 0.0, 0.0, 0.0, 0.009471417, -0.12957802, 0.096014425, 0.21836184, 0.00021601951, -0.22997683, 0.23666254, 0.41192335, 0.021762101, 0.0047863554, 0.008233427, 0.108514786, 0.0, 0.0, 0.0, 0.0, -0.01156376, -0.18988979, 0.04614705, -0.044767227, 0.01050636, -0.26426336, 0.23741047, 0.0027636609, -0.027718676, -0.14202335, -0.016650287, -0.06637125, 0.0, 0.0, 0.0, 0.0, 0.057809234, -0.11033858, 0.056533534, -0.06292466, 0.13880666, -0.18710336, 0.2441031, -0.25326246, 0.0032683122, -0.026437074, 0.0023248852, 7.640766e-05, 0.0, 0.0, 0.0, 0.0, -0.49110603, 0.4429004, -0.44015464, -0.41174838, -0.87738293, 0.7808468, -1.0929365, -0.59699076, -0.18409836, 0.185138, -0.11773224, -0.17097276, 0.0, 0.0, 0.0, 0.0, 0.10580959, -0.055947904, -0.03431237, -0.080236495, 0.14862584, -0.15393938, -0.18872876, -0.3170681, 0.03559387, -0.003990826, 0.021298569, 0.012844483, 0.0, 0.0, 0.0, 0.0, -0.040715586, -0.25781113, 0.08896714, -0.1225879, -0.15790503, -0.54010904, 0.29588607, 0.10401059, 0.003413123, -0.108357325, 0.0112870345, -0.11888622, 0.0, 0.0, 0.0, 0.0, 0.0049315444, 0.02376202, -0.08224771, 0.121118225, -0.041512914, -0.027994309, -0.585988, -0.069672115, -0.017247835, 0.0056576864, 0.04319012, 0.055003505, 0.0, 0.0, 0.0, 0.0, 0.37521392, 0.15916082, 0.059708964, 0.19046007, 0.8120325, 0.38343868, 0.3436578, 0.5287958, 0.16570656, 0.06957687, 0.014022592, 0.074799836, 0.0, 0.0, 0.0, 0.0], "bias": [-0.01050964, -0.00939481, 0.17684458, 0.027366742]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf"], "output": "conv2d_1_tf", "weights": [-0.011029496, 0.05866063, -0.09460646, -0.017664742, -0.022488879, 0.18384217, -0.00397663, -0.064733066, 0.08466802, 0.10667488, 8.0212536e-05, 0.0908869, 0.13580276, 0.00097438256, 0.12176522, -0.08218466, 0.16062798, -0.10190268, 0.03280682, 0.05621916, -0.009684231, -0.08464307, 0.17058301, -0.096469186, 0.1967505, -0.1450099, 0.093607284, -0.28240147, -0.21377413, 0.10079291, -0.1741522, 0.17330575, -0.060160473, 0.06316997, 0.0046929033, -0.049405966, 0.13851729, 0.06830702, -0.0586872, -0.040827133, 0.007052838, -0.03576886, -0.111261636, 0.039155316, -0.07380389, -0.09369825, 0.04471156, 0.09678487, -0.36683616, -0.035950605, -0.24414362, -0.009159744, 0.19335322, -0.099253505, 0.075083904, -0.00076695543, 0.65291303, -0.25599423, 0.19827642, 0.065899536, -0.07423247, -0.068967685, 0.0050554527, -0.060272824, -0.020688485, -0.83178276, 0.11104878, 0.26454413, 0.13655476, 0.37675047, -0.22219229, -0.01751935, 0.44552696, 0.92510307, 0.16063261, -0.62011045, 0.19366647, -0.06996067, -0.2504841, 0.00803723, 0.0051537007, -0.057168536, -0.16110587, 0.25232598, -0.04447099, 0.11997351, 0.14808103, -0.34443566, -0.26212573, -0.21970181, 0.2724405, 0.21050811, -0.07949061, -0.064808235, -0.21208277, -0.0042361654, -0.0888952, -0.20169449, 0.19144905, -0.016882861, -0.013283103, 0.07552998, -0.24686803, 0.012453213, -0.065454446, -0.016123284, -0.47316182, 0.070926026, 0.09219782, 0.13118166, 0.074736096, 0.0077910526, 0.5832154, 0.1138069, -0.039765622, 0.3182784, -0.25497997, 0.0013993139, 0.39285088, -0.48511526, -0.39891505, -0.19094779, -0.082146175, -0.20826934, 0.020590555, -0.0012490178, -0.4398621, 0.14377014, 0.21917395, 3.4314657e-05, 0.25734863, -0.3433305, 0.015720673, 0.2676127, -0.06807297, 0.15040149, -0.23638041, -0.0050233034, -0.13666134, 0.4542111, -0.033572577, -0.08450588, -0.23341487, 0.053490847, -0.17482175, 0.057647135, 0.33135444, 0.0850751, -0.1718849, -0.0854123, 0.036795795, -0.13874969, -0.10903869, -0.19007301, -0.06064334, -0.03786032, -0.036696054, 0.07844446, 0.012523185, -0.01562906, -0.04411997, -0.10331819, 0.10050193, 0.12406485, 0.07431592, 0.30109692, -0.17511666, -0.13263564, -0.10192587, 0.07821255, -0.22415096, 0.25552443, 0.17881326, -0.13914281, 0.109979235, -0.0016463579, -0.01911644, -0.15412527, 0.028903123, 0.20831817, 0.00375175, 0.08110953, 0.074919395, -0.17581624, -0.015677985, 0.06504228, 0.08817818, -0.12518327, -0.09537373, 0.028905088, -0.051288474, 0.054334078, 0.2852779, -0.28924024, 0.36805123, 0.21079305, -0.28336474, 0.1679663, -0.08641141, -0.10699407, -0.16090055, 0.1287612, -0.15910125, 0.05734755, 0.15883245, 0.0053026294, 0.080674745, 0.0505137, 0.17639062, 0.3790122, -0.19588692, -0.020314282, 0.26197383, 0.09014768, 0.19696823, -0.41025418, -0.08308115, -0.33279485, -0.22528782, 0.06172439, -0.1365661, -0.13094363, -0.005086559, 0.089024484, 0.05262993, 0.0006296959, 0.1657725, -0.32591924, 0.12126701, 0.061543245, -0.10526848, 0.041583937, 0.094976954, 0.09416157, -0.22019257, -0.058390073, -0.2073888, 0.057273377, 0.19558284, 0.004208022, 0.30005738, 0.18478931, -0.23342943, Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-2x-s", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.25782192, 0.15356855, -0.07591801, 0.025576258, 0.15639038, -0.003467518, 0.12388964, -0.074463956, 0.1363419, 0.10602972, -0.08083917, -0.0098574, 0.0, 0.0, 0.0, 0.0, 0.23684815, -0.06991441, -0.26512906, 0.04322338, 0.13556279, -0.35494795, -0.13624676, 0.020295974, -0.0999787, -0.04245641, -0.1272923, 0.10147985, 0.0, 0.0, 0.0, 0.0, 0.12914264, 0.09177784, 0.3579164, -0.11445263, -0.16305687, 0.052706085, 0.36622983, -0.0011837523, 0.033064514, 0.096229866, 0.0552606, -0.034237757, 0.0, 0.0, 0.0, 0.0, 0.27514997, -0.1300823, 0.027395383, 0.12283199, 0.5383546, 0.09842804, -0.12462158, -0.17170155, -0.01863094, -0.10540424, 0.18628319, 0.12033461, 0.0, 0.0, 0.0, 0.0, -0.43199503, -0.41099274, -0.3517322, -0.44664156, -0.4758843, -0.24648757, -0.3566836, -0.017266102, -0.20802185, -0.3654689, -0.19757888, -0.29120144, 0.0, 0.0, 0.0, 0.0, -0.15593381, -0.18778, 0.2499271, -0.037658677, 0.14603312, 0.015572719, 0.10806066, -0.4077356, -0.1000264, -0.12753147, 0.18192403, -0.24150863, 0.0, 0.0, 0.0, 0.0, 0.07505814, 0.015251832, 0.09499054, 0.044957004, -0.18697514, 0.02458684, -0.02497988, -0.029909676, -0.05428892, 0.106657036, -0.06808904, -0.041664355, 0.0, 0.0, 0.0, 0.0, -0.20078097, 0.03437222, 0.038230244, 0.10970939, -0.43864843, -0.13626677, 0.17990443, 0.41581368, 0.024597576, 0.11880136, -0.10763169, 0.19922386, 0.0, 0.0, 0.0, 0.0, 0.3384449, 0.14787383, -0.08111384, 0.32002708, 0.33851552, 0.0048022484, -0.1369224, 0.37011376, 0.25997162, 0.06434332, 0.15082477, 0.2148611, 0.0, 0.0, 0.0, 0.0], "bias": [-0.09206034, 0.14355598, 0.10932139, 0.0016021392]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf"], "output": "conv2d_1_tf", "weights": [-0.095783316, 0.16888501, 0.05321395, -0.030030794, -0.08823816, -0.045243666, -0.06268558, 0.21276858, -0.0624856, -0.01006017, 0.0030589101, -0.058050346, -0.10185547, 0.013074036, -0.060340375, -0.059404477, -0.082710035, -0.3164221, -0.14149888, -0.0500287, 0.1165336, -0.24514209, -0.22980696, -0.08769986, -0.12874982, 0.026991324, -0.051623344, -0.09652709, -0.13059464, -0.1155648, -0.15023601, -0.2606064, 0.13881665, 0.06292556, -0.073230885, 0.030548356, -0.1894414, 0.20438747, -0.1020142, 0.038716204, 0.047450725, -0.042745817, -0.009961303, 0.0043113427, -0.103798516, 0.0057283384, 0.025602754, 0.06838202, -0.084471785, 0.1186411, -0.023158437, -0.019586418, 0.14019564, -0.20072576, -0.09657145, -0.03009908, -0.13227277, -0.08167413, -0.036809705, 0.15459986, -0.1175294, -0.0159718, -0.07684084, 0.0029121442, 0.38679013, -0.086696684, 0.040943615, -0.10347326, -0.113701634, -0.16794261, 0.46800423, -0.4380119, -0.063318215, -0.07943689, 0.014833392, 0.09416196, 0.088914625, 0.021966234, -0.0046327873, -0.2657651, -0.22693971, 0.1888593, 0.14114356, -0.052431874, 0.019335985, 0.15687473, 0.14059441, -0.049555086, -0.032860175, 0.03814611, 0.19610809, -0.07544432, 0.19492854, -0.0364603, -0.0852338, 0.0940062, 0.01977914, 0.07460088, 0.00649084, -0.0076678796, -0.042637978, 0.13390307, -0.12892081, 0.1885971, -0.26436746, -0.054088645, -0.05617448, -0.11635425, 0.10515732, 0.070723996, -0.011394824, -0.058781527, 0.036073864, 0.20427327, -0.05082124, -0.07998257, -0.11126785, -0.32909214, 0.16723558, -0.06990673, 0.068846, 0.07962057, -0.09518244, 0.1964481, -0.18227482, 0.0012983003, -0.010337137, 0.059369925, -0.017423645, -0.015004898, -0.12347797, 0.03555082, 0.16950843, 0.3905411, 0.31619287, 0.07669911, 0.06830832, -0.15560928, 0.011061299, -0.0471216, -0.019609185, -0.10293927, -0.0074584717, 0.025274256, 0.0401996, 0.04994626, 0.04033721, -0.031158779, -0.020250803, -0.04343525, 0.008512854, -0.025068643, 0.024087055, 0.14313996, -0.017925745, 0.14695233, 0.17547527, -0.12131518, 0.08256627, 0.024314117, 0.073618114, 0.11204843, 0.029775916, -0.06307828, -0.048083175, 0.17052896, -0.016592458, 0.04766689, 0.264522, -0.07116043, -0.027477346, 0.11058124, 0.26533633, -0.009387501, 0.19483726, 0.059977174, -0.12358764, -0.025961788, 0.04777405, -0.08508629, 0.18727924, -0.02720344, -0.07284181, 0.08025612, -0.012793925, -0.02129287, -0.014057591, -0.10034754, 0.057004917, 0.0037808765, -0.03774303, -0.003233076, -0.017357104, -0.0037230153, -0.006728777, -0.037507925, -0.009744604, 0.07082, -0.03264124, -0.14104879, 0.37448314, 0.12911771, 0.02214634, -0.43490615, 0.12378615, 0.094145015, -0.07473948, 0.0048840935, -0.099796765, 0.05870187, -0.11705587, 0.05676388, 0.023533033, -0.032874126, -0.06726595, 0.012210867, -0.09490625, 0.09094358, -0.10220125, 0.064988695, -0.097893566, -0.023668293, -0.27130198, 0.18235227, 0.07178437, -0.07974578, -0.21608166, 0.13351338, 0.07526229, -0.013628629, 0.20969899, 0.019102097, 0.061184246, -0.077816315, -0.058578897, 0.08472013, -0.09029159, -0.01493887, -0.042308304, 0.03848113, -0.027789878, -0.0044137137, -0.0030754514, -0Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-restore-l", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.27899465, -0.14974926, 0.6271667, -0.04888494, 0.2164516, -0.47826648, 0.09537477, 0.16404815, -0.009546488, -0.24541017, -0.20505093, -0.11507772, 0.0, 0.0, 0.0, 0.0, -0.22372562, 0.046120282, 0.44437107, 0.54215515, -0.10638798, -0.010795577, 0.19478157, 0.5756847, 0.24542068, 0.11135218, -0.27672207, 0.09624475, 0.0, 0.0, 0.0, 0.0, 0.1703517, -0.17810228, -0.34460765, -0.40586865, 0.2102622, 0.08207581, 0.17641851, 0.23701222, -0.32159516, -0.017147528, 0.41743183, 0.19025058, 0.0, 0.0, 0.0, 0.0, 0.4708481, -0.1587934, -0.15760423, -0.11388875, -0.36032093, -0.044305246, 0.19414884, 0.31109568, -0.09320259, -0.23072109, 0.0242641, 0.040976923, 0.0, 0.0, 0.0, 0.0, 0.00951417, 0.2746557, -0.49743456, 0.14564055, 0.15047263, 0.08832856, -0.24360974, -0.3517844, -0.12219134, 0.12957081, 0.2876983, 0.13303527, 0.0, 0.0, 0.0, 0.0, -0.12760738, 0.16703783, 0.04391735, 0.34657615, -0.26698044, -0.096000046, -0.46030682, -0.38363042, 0.3510441, 0.2620507, -0.30533043, -0.32785, 0.0, 0.0, 0.0, 0.0, 0.63138646, -0.12703805, 0.38107973, -0.09134196, -0.04012397, -0.1390924, 0.07578805, -0.09274019, -0.045394078, 0.18203364, 0.16900069, 0.13399005, 0.0, 0.0, 0.0, 0.0, -0.13648264, -0.13971807, -0.32322997, -0.08377875, 0.40967095, 0.19853555, -0.26386982, -0.50860924, -0.00555831, 0.06922444, 0.034828495, -0.08413197, 0.0, 0.0, 0.0, 0.0, 0.21196735, 0.24934316, -0.27111465, -0.19941513, -0.30186844, 0.44828892, 0.35906994, -0.35723612, -0.074009515, -0.34400147, -0.22145566, -0.15622428, 0.0, 0.0, 0.0, 0.0], "bias": [-0.44569078, -0.084358215, -0.014156722, -0.0353374]}, "conv2d_tf1": {"name": "conv2d_tf1", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf1", "weights": [0.1953752, -0.09707663, 0.43315637, 0.3862221, 0.2346731, 0.085327715, 0.36244828, 0.06630519, -0.05342483, 0.112148136, 0.07938104, 0.14795923, 0.0, 0.0, 0.0, 0.0, 0.25197014, 0.032906674, 0.3392793, 0.18099307, -0.36539522, 0.10986396, 0.5440999, 0.41803896, -0.4117931, 0.46616048, 0.0827279, 0.040264074, 0.0, 0.0, 0.0, 0.0, -0.060543116, 0.34531194, -0.3202978, 0.32803985, -0.08720925, 0.63656414, -0.052656054, -0.076137036, 0.15297869, -0.11485237, -0.21027736, -0.24086118, 0.0, 0.0, 0.0, 0.0, -0.2044052, 0.111065395, -0.36082193, -0.39179638, 0.19812255, -0.3797384, 0.03176089, -0.35085422, 0.31697252, -0.31267545, -0.068170965, -0.06266394, 0.0, 0.0, 0.0, 0.0, 0.0055682547, 0.24352197, 0.08972456, -0.4340704, -0.25253078, -0.4218859, 0.08408476, -0.5052765, 0.005511427, -0.36491954, 0.3825727, 0.01774532, 0.0, 0.0, 0.0, 0.0, 0.13323675, -0.6641518, -0.38277033, 0.67553586, -0.5879293, -0.1286407, 0.1355451, 0.19463064, -0.09206729, 0.41892347, 0.16736335, -0.017109495, 0.0, 0.0, 0.0, 0.0, 0.0627963, 0.29361042, 0.23339616, -0.42217752, 0.21872504, -0.21531922, -0.5016595, 0.20158494, 0.2814043, -0.1474019, 0.08778552, 0.28085083, 0.0, 0.0, 0.0, 0.0, -0.009900911, -0.42754972, 0.02737237, -0.17740859, 0.541632, -0.28397697, -0.36375052, -0.172693, 0.1506882, 0.15196925, -0.30358136, -0.29542333, 0.0, 0.0, 0.0, 0.0, -0.3690586, 0.19382606, -0.040331036, -0.14121497, 0.121049926, 0.54470515, -0.23628974, 0.20663929, -0.34591553, -0.14778244, -0.23809184, 0.12616424, 0.0, 0.0, 0.0, 0.0], "bias": [-0.009787335, 0.051148742, -0.007458707, -0.016416457]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf", "conv2d_tf1"], "output": "conv2d_1_tf", "weights": [0.028458824, 0.10831271, 0.017246738, 0.42066097, 0.035127334, 0.14161696, 0.3893337, 0.18358134, -0.26446894, -0.053199783, 0.053528484, -0.3486933, -0.10270838, -0.3593573, 0.049874853, 0.08600247, -0.15829772, -0.31038332, 0.0423391, -0.11978196, -0.29878524, 0.10245719, 0.004307728, 0.052934717, -0.049366333, -0.03277819, -0.062031534, -0.004734159, 0.029009456, -0.18138678, 0.17342477, -0.1632741, -0.14941882, -0.3337916, -0.07740701, -0.8221198, -0.014216013, -0.34028724, 0.06367363, -0.19704603, -0.20317195, 0.17806017, -0.14011545, 0.05067841, 0.08515265, 0.092163175, -0.036603887, -0.2528259, 0.044333473, 0.10871938, -0.12288588, 0.0077913217, 0.013970764, -0.21189599, -0.0757029, 0.055366833, 0.04531751, -0.20269018, 0.038650505, -0.09677452, 0.0565207, 0.073703125, -0.10746413, 0.22798601, 0.33476707, 0.22631067, 0.10190012, 0.25268495, -0.14572862, -0.21331434, 0.024614803, -0.26254398, 0.18070522, 0.34974626, 0.028480766, -0.07855834, 0.16165797, 0.28470036, 0.23497322, -0.15804033, -0.09853942, -0.21105993, 0.27787793, 0.24688315, -0.16078049, 0.08541815, 0.16101131, -0.0005086922, -0.13042259, 0.0253011, -0.05298311, 0.16506846, -0.099300735, 0.07577514, 0.041623414, -0.18045023, -0.015007392, 0.0720429, -0.018456718, 0.012792885, 0.2049891, -0.061911974, -0.10679284, 0.2530616, -0.1651912, 0.1125125, 0.55918777, 0.1414716, 0.025189033, 0.061680123, -0.13096866, -0.035809774, 0.037606Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-restore-m", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.09991986, 0.13782342, -0.031251684, -0.06356843, -0.3437488, 0.05450952, 0.34347802, 0.46335372, 0.08607224, 0.044988394, 0.137179, 0.17976908, 0.0, 0.0, 0.0, 0.0, -0.024212424, -0.09278509, -0.00040907756, 0.34552294, -0.13254678, 0.113105185, 0.005667946, -0.00036919137, -0.06375679, 0.009184115, 0.115518734, -0.115506776, 0.0, 0.0, 0.0, 0.0, -0.14101827, 0.023523493, 0.044094566, -0.019271746, -0.44348842, -0.08818877, -0.4026149, -0.21995795, -0.15880394, -0.013732858, -0.020751135, 0.012719151, 0.0, 0.0, 0.0, 0.0, 0.013001821, -0.34503505, 0.39219138, 0.18792126, 0.24760444, -0.016173402, 0.10154511, 0.15453082, -0.058132876, 0.016784398, -0.05808539, -0.11039915, 0.0, 0.0, 0.0, 0.0, 0.37024534, 0.041440863, -0.3374568, -0.44994286, 0.19555596, 0.20855539, -0.27974075, -0.5372628, 0.21228147, -0.0295346, -0.56700057, 0.030042822, 0.0, 0.0, 0.0, 0.0, -0.12940632, 0.057526, 0.090682045, -0.06985033, -0.13704006, -0.047685407, 0.44615674, -0.48056605, -0.06166251, -0.01883519, 0.2032237, -0.113287605, 0.0, 0.0, 0.0, 0.0, 0.010856669, -0.35820737, 0.16757219, 0.082619876, -0.03967303, 0.038705572, 0.32652855, -0.012030017, 0.015120559, -0.15314877, 0.23442009, 0.09767922, 0.0, 0.0, 0.0, 0.0, -0.046272673, -0.17752305, 0.082018286, -0.2512824, 0.58619463, -0.060903464, -0.022793597, 0.077803515, -0.17025311, 0.05136993, 0.029383298, -0.15475409, 0.0, 0.0, 0.0, 0.0, -0.11212024, 0.13378005, -0.2027488, 0.08056421, -0.11176219, -0.048429377, -0.08396386, 0.10507829, 0.13326839, 0.0430627, 0.051362377, 0.06482755, 0.0, 0.0, 0.0, 0.0], "bias": [-0.061233472, 0.39222646, 0.029704979, 0.02586828]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf"], "output": "conv2d_1_tf", "weights": [-0.16410656, -0.40521824, 0.13121907, -0.02314597, 0.105412476, -0.060401272, -0.043063477, -0.13933973, 0.12558138, -0.020861467, 0.030370515, 0.13178016, -0.14220351, 0.20736893, 0.003321564, -0.29241714, 0.18517321, 0.29162985, -0.26783395, 0.039760686, 0.025527012, -0.067319244, 0.055004176, 0.048916563, 0.12750523, -0.091435954, 0.13818842, 0.36704224, 0.0839921, 0.10186618, -0.17237376, 0.13282418, -0.1657887, 0.0131325135, -0.17222486, 0.091398895, -0.12756164, -0.08437298, -0.29052997, 0.3269337, 0.15870757, -0.013529402, -0.0581753, 0.11802371, 0.07099966, -0.024063632, 0.31834844, -0.11183859, 0.46036887, -0.07654623, 0.22923063, 0.17463821, 0.10555414, -0.117430426, 0.12406777, -0.011399492, 0.028316498, 0.13684341, 0.009664087, 0.2022659, 0.04953974, -0.31342217, -0.6103131, -0.13605757, 0.03406955, -0.39819366, 0.61176, -0.46809456, -0.029321073, 0.46619493, 0.36700186, 0.02288561, 0.11464085, -0.10931452, -0.09154022, 0.07334147, -0.5609916, 0.31826234, -0.011012659, -0.46719545, -0.056855045, 0.27037027, -0.09269696, -0.563572, -0.06816116, -0.22986612, 0.08693167, -0.16246101, 0.09954046, -0.05374176, 0.0071916827, -0.1788692, 0.3825241, -0.1609887, 0.055204768, 0.10213068, 0.0646626, 0.102358796, -0.45055822, 0.20557903, -0.23337309, 0.12633002, -0.19299199, -0.15085731, -0.13473304, 0.053790465, -0.10061193, -0.13393497, -0.04264752, -0.029740738, -0.07865285, 0.20883279, 0.010471527, -0.033218473, -0.46157447, 0.004866583, 0.23226471, -0.059343327, -0.1439596, 0.13619648, 0.013839963, 0.15930325, 0.043742355, 0.17467323, 0.33772305, 0.40261495, -0.08351293, 0.18129359, -0.12493434, -0.1875134, -0.074943796, -0.0031701606, -0.037142616, 0.1667002, 0.16665547, -0.011248127, 0.0071619414, 0.0034872112, 0.120318964, -0.09625579, 0.14917047, -0.16310586, 0.07231737, 0.30447328, 0.093798615, 0.17074613, -0.08780678, -0.012520207, 0.118534856, 0.027508778, -0.2778478, -0.19509242, -0.34137097, 0.32000312, -0.22027159, 0.337515, 0.16220862, 0.108993016, 0.14070526, 0.12784284, -0.14325632, -0.1467453, -0.27502358, 0.09370837, 0.11821083, -0.012266484, -0.2100548, 0.4707502, -0.06766648, 0.58165014, -0.2512279, -0.33783755, 0.1318925, -0.04346277, 0.15454485, 0.044500057, -0.05683207, 0.0051946463, -0.108000524, 0.10133204, -0.50763863, 0.007308442, 0.8542404, 0.28387356, 0.022709515, 0.294523, -0.3822472, 0.66166407, 0.01404485, 0.031282708, -0.26756814, -0.123147786, -0.36455178, 0.3470555, -0.045303088, -0.03170764, -0.15802494, -0.0019141496, -0.25939587, -0.23875342, 0.130428, 0.03954273, -0.17985536, 0.105145946, 0.15804817, 0.12551713, 0.28371975, -0.085748516, 0.0060625463, 0.2443924, -0.017692259, -0.20214005, -0.09584515, -0.012805372, -0.13942227, 0.16143198, 0.12942013, 0.41785547, 0.046071563, 0.7030026, 0.10499644, -0.20566013, -0.031321276, 0.27830327, -0.081274964, -0.14562319, 0.27200526, -0.20491314, 0.012910989, 0.024201397, 0.04816258, 0.21297328, -0.22015952, -0.44160756, -0.056035373, 0.33824417, -0.31645304, 0.15469243, 0.053187452, -0.20989445, -0.046550367, 0.033185404, 0.33337244, 0.12853645, 0.23520172, -0.05Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
{"name": "anime4k/cnn-restore-s", "layers": {"conv2d_tf": {"name": "conv2d_tf", "type": "conv", "inputs": ["input_image"], "output": "conv2d_tf", "weights": [-0.19288683, -0.21397883, 0.111997396, -0.04791413, -0.26682988, -0.06144587, -0.03601853, -0.16693151, 0.038494494, -0.16651472, 0.147657, -0.083003886, 0.0, 0.0, 0.0, 0.0, -0.14286195, 0.08746566, -0.40107322, 0.12390977, -0.33392772, -0.18703035, -0.21326795, 0.04780781, -0.15155545, -0.0010025925, -0.1554875, -0.10676251, 0.0, 0.0, 0.0, 0.0, 0.28095165, 0.022872915, -0.21342312, -0.29982176, 0.025937587, -0.055012174, -0.33779636, 0.0015666655, 0.076416336, 0.06656033, -0.1557806, 0.1078894, 0.0, 0.0, 0.0, 0.0, -0.31584853, 0.07527119, 0.30713862, -0.34014285, -0.50103146, -0.07217874, 0.512807, -0.09597398, -0.32097813, -0.051580857, -0.022466356, 0.01148551, 0.0, 0.0, 0.0, 0.0, -0.026032459, -0.04193211, 0.37703893, -0.031916667, -0.27421117, 1.0906446, -0.049654085, -0.19814016, 0.07819544, 0.06003738, 0.1405805, -0.0064135445, 0.0, 0.0, 0.0, 0.0, 0.041450135, 0.11319654, -0.23237701, 0.08443178, 0.53344345, 0.30857387, -0.057264958, -0.1575803, 0.2325609, -0.027797326, -0.04544767, -0.18720597, 0.0, 0.0, 0.0, 0.0, 0.2531829, -0.074966915, -0.27800754, -0.3146097, 0.20126024, -0.5380133, -0.15082566, -0.19021043, 0.29951036, 0.17123336, -0.01681872, -0.12574998, 0.0, 0.0, 0.0, 0.0, 0.25203633, 0.19882993, 0.14906439, 0.13593598, 0.40712556, 0.084902965, 0.42969635, 0.2961132, -0.057267334, -0.030388135, 8.8084314e-05, 0.0210724, 0.0, 0.0, 0.0, 0.0, -0.13459359, -0.12199573, 0.12591946, 0.24736497, 0.2033463, -0.09388599, -0.094370656, 0.1071285, -0.18479438, -0.066625565, 0.08279283, 0.20130983, 0.0, 0.0, 0.0, 0.0], "bias": [-0.011108127, -0.07481861, 0.07640154, 0.4964964]}, "conv2d_1_tf": {"name": "conv2d_1_tf", "type": "conv", "inputs": ["conv2d_tf"], "output": "conv2d_1_tf", "weights": [-0.056432575, 0.0028165397, -0.026325442, -0.14802271, 0.16885762, -0.062179096, -0.2332292, 0.17513658, -0.08011296, 0.02947316, 0.014771492, -0.17946689, 0.026012989, -0.09823925, 0.036625937, -0.06924322, -0.13571467, 0.09831142, 0.12911566, 0.06305893, -0.07188695, -0.20161287, 0.3858435, -0.21069056, -0.12294444, -0.1404628, -0.022659872, 0.23008968, 0.10969853, 0.17640765, 0.39796907, 0.20413099, -0.0061665224, 0.055102807, -0.0059629944, -0.021429887, 0.061626043, 0.16898955, -0.21215646, 0.16510476, 0.2238265, 0.19429931, 0.09874656, 0.06828208, -0.122404456, -0.00026717107, -0.28203064, -0.29979932, -0.22735378, 0.14538136, 0.11549746, 0.194148, -0.09841722, -0.0661309, 0.348576, -0.017375294, -0.044078812, 0.1298332, 0.04793373, -0.30687734, 0.08353025, 0.083519086, 0.10766399, 0.31796935, 0.048365135, -0.17566709, -0.33212858, -0.052667376, -0.26443407, -0.010216014, 0.1573303, 0.05725314, 0.08140953, -0.09664591, 0.076109104, -0.026773714, 0.07732627, 0.10188082, -0.28266954, -0.16230233, 0.29931107, 0.117944, -0.10414009, 0.12795551, 0.12576093, 0.17082554, -0.15803693, 0.13430743, -0.025801308, -0.10797019, 0.0721032, 0.2825884, -0.11025257, 0.12798019, 0.081827976, -0.050441865, -0.11827391, 0.08306765, -0.3430314, 0.07898041, -0.023839617, -0.019507334, 0.23176382, -0.40992323, 0.09411734, 0.38415068, -0.25845516, -0.29984522, 0.1470966, -0.0684779, -0.07071314, -0.026773235, 0.19091596, 0.082110435, -0.5266589, -0.1744098, -0.015838385, -0.046316292, 0.023171103, -0.03731331, 0.2642396, 0.31824252, -0.041754793, -0.09525519, -0.14696182, 0.052168854, 0.039857205, -0.027555354, 0.15207373, 0.09845733, 0.0142631065, 0.096375965, 0.06089903, 0.17902578, -0.42391995, 0.22475442, 0.016356342, -0.06277531, -0.12173141, -0.18635495, -0.0013459618, 0.15725887, 0.019310836, 0.20293565, -0.18395247, 0.30672902, 0.09034339, 0.1821889, -0.0419004, -0.2169228, -0.14052129, 0.11006559, 0.1709272, 0.51062274, 0.13758625, -0.2242552, -0.030382963, 0.3357568, -0.26491287, 0.02501938, 0.040511727, 0.12523083, -0.27318433, 0.08388512, 0.25354835, 0.3404216, -0.2632471, -0.17784123, 0.2732347, 0.4468553, 0.084667034, -0.1856242, 0.034099877, -0.00954992, -0.32751867, -0.062207516, 0.17564747, 0.11645554, -0.16362113, 0.105654195, -0.2762563, -0.1413764, 0.23264363, -0.14000498, 0.095402054, 0.0715738, -0.19346157, -0.028285999, 0.009799127, 0.04059529, 0.19688335, 0.1282381, 0.23575781, -0.11446148, -0.20504695, 0.035568226, 0.36890212, -0.85968876, -0.18545328, 0.33796397, -0.30916876, -0.10445518, -0.3046253, 0.33271998, -0.06263589, -0.2160114, -0.16383372, -0.31173357, 0.20469664, 0.4039374, -0.070057206, 0.030353077, 0.39843914, -0.15490077, -0.24476516, 0.38238233, -0.21809858, 0.23496576, -0.051794037, 0.033664484, -0.14411364, -0.2515329, 0.124655396, -0.05818785, -0.09065731, -0.16787091, 0.013269188, 0.23687351, -0.41504318, -0.048163068, 0.31760025, -0.33648986, 0.29752317, 0.2926866, 0.14408836, -0.33382463, -0.15873958, -0.121961035, 0.11797893, 0.09000567, 0.13356976, 0.013763947, 0.012169505, -0.109594524, 0.03417223, 0.7031121, 0.65146804, 0.525Line truncated
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
(globalThis.webpackChunkfree_video_upscaler=globalThis.webpackChunkfree_video_upscaler||[]).push([[869],{41:(t,e)=>{var i,r,s=(i=new Date,r=4,{setLogLevel:function(t){r=t==this.debug?1:t==this.info?2:t==this.warn?3:(this.error,4)},debug:function(t,e){void 0===console.debug&&(console.debug=console.log),1>=r&&console.debug("["+s.getDurationString(new Date-i,1e3)+"]","["+t+"]",e)},log:function(t,e){this.debug(t.msg)},info:function(t,e){2>=r&&console.info("["+s.getDurationString(new Date-i,1e3)+"]","["+t+"]",e)},warn:function(t,e){3>=r&&console.warn("["+s.getDurationString(new Date-i,1e3)+"]","["+t+"]",e)},error:function(t,e){4>=r&&console.error("["+s.getDurationString(new Date-i,1e3)+"]","["+t+"]",e)}});s.getDurationString=function(t,e){var i;function r(t,e){for(var i=(""+t).split(".");i[0].length<e;)i[0]="0"+i[0];return i.join(".")}t<0?(i=!0,t=-t):i=!1;var s=t/(e||1),a=Math.floor(s/3600);s-=3600*a;var n=Math.floor(s/60),o=1e3*(s-=60*n);return o-=1e3*(s=Math.floor(s)),o=Math.floor(o),(i?"-":"")+a+":"+r(n,2)+":"+r(s,2)+"."+r(o,3)},s.printRanges=function(t){var e=t.length;if(e>0){for(var i="",r=0;r<e;r++)r>0&&(i+=","),i+="["+s.getDurationString(t.start(r))+","+s.getDurationString(t.end(r))+"]";return i}return"(empty)"},e.Log=s;var a=function(t){if(!(t instanceof ArrayBuffer))throw"Needs an array buffer";this.buffer=t,this.dataview=new DataView(t),this.position=0};a.prototype.getPosition=function(){return this.position},a.prototype.getEndPosition=function(){return this.buffer.byteLength},a.prototype.getLength=function(){return this.buffer.byteLength},a.prototype.seek=function(t){var e=Math.max(0,Math.min(this.buffer.byteLength,t));return this.position=isNaN(e)||!isFinite(e)?0:e,!0},a.prototype.isEos=function(){return this.getPosition()>=this.getEndPosition()},a.prototype.readAnyInt=function(t,e){var i=0;if(this.position+t<=this.buffer.byteLength){switch(t){case 1:i=e?this.dataview.getInt8(this.position):this.dataview.getUint8(this.position);break;case 2:i=e?this.dataview.getInt16(this.position):this.dataview.getUint16(this.position);break;case 3:if(e)throw"No method for reading signed 24 bits values";i=this.dataview.getUint8(this.position)<<16,i|=this.dataview.getUint8(this.position+1)<<8,i|=this.dataview.getUint8(this.position+2);break;case 4:i=e?this.dataview.getInt32(this.position):this.dataview.getUint32(this.position);break;case 8:if(e)throw"No method for reading signed 64 bits values";i=this.dataview.getUint32(this.position)<<32,i|=this.dataview.getUint32(this.position+4);break;default:throw"readInt method not implemented for size: "+t}return this.position+=t,i}throw"Not enough bytes in buffer"},a.prototype.readUint8=function(){return this.readAnyInt(1,!1)},a.prototype.readUint16=function(){return this.readAnyInt(2,!1)},a.prototype.readUint24=function(){return this.readAnyInt(3,!1)},a.prototype.readUint32=function(){return this.readAnyInt(4,!1)},a.prototype.readUint64=function(){return this.readAnyInt(8,!1)},a.prototype.readString=function(t){if(this.position+t<=this.buffer.byteLength){for(var e="",i=0;i<t;i++)e+=String.fromCharCode(this.readUint8());return e}throw"Not enough bytes in buffer"},a.prototype.readCString=function(){for(var t=[];;){var e=this.readUint8();if(0===e)break;t.push(e)}return String.fromCharCode.apply(null,t)},a.prototype.readInt8=function(){return this.readAnyInt(1,!0)},a.prototype.readInt16=function(){return this.readAnyInt(2,!0)},a.prototype.readInt32=function(){return this.readAnyInt(4,!0)},a.prototype.readInt64=function(){return this.readAnyInt(8,!1)},a.prototype.readUint8Array=function(t){for(var e=new Uint8Array(t),i=0;i<t;i++)e[i]=this.readUint8();return e},a.prototype.readInt16Array=function(t){for(var e=new Int16Array(t),i=0;i<t;i++)e[i]=this.readInt16();return e},a.prototype.readUint16Array=function(t){for(var e=new Int16Array(t),i=0;i<t;i++)e[i]=this.readUint16();return e},a.prototype.readUint32Array=function(t){for(var e=new Uint32Array(t),i=0;i<t;i++)e[i]=this.readUint32();return e},a.prototype.readInt32Array=function(t){for(var e=new Int32Array(t),i=0;i<t;i++)e[i]=this.readInt32();return e},e.MP4BoxStream=a;var n=function(t,e,i){this._byteOffset=e||0,t instanceof ArrayBuffer?this.buffer=t:"object"==typeof t?(this.dataView=t,e&&(this._byteOffset+=e)):this.buffer=new ArrayBuffer(t||0),this.position=0,this.endianness=null==i?n.LITTLE_ENDIAN:i};n.prototype={},n.prototype.getPosition=function(){return this.position},n.prototype._realloc=function(t){if(this._dynamicSize){var e=this._byteOffset+this.position+t,i=this._buffer.byteLength;if(e<=i)e>this._byteLength&&(this._byteLength=e);else{for(i<1&&(i=1);e>i;)i*=2;var r=new ArrayBuffer(i),s=new Uint8Array(this._buffer);new Uint8Array(r,0,s.length).set(s),this.buffer=r,this._byteLength=e}}},n.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var t=new ArrayBuffer(this._byteLength),e=new Uint8Array(t),i=new Uint8Array(this._buffer,0,e.length);e.set(i),this.buffer=t}},n.BIG_ENDIAN=!1,n.LITTLE_ENDIAN=!0,Line truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1 +1 @@
|
||||
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAEwB;AAFxB;;AAEe,SAAS,qBAAqB,SAAS,CAAC,CAAC;IACpD,OAAO,CAAC;QACJ,MAAM,EACF,UAAU,EAAE,OAAO,EAAE,EACrB,aAAa,EACT,SAAS,EACT,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,EAC/B,EACJ,GAAG;QAEJ,kBAAkB;QAClB,SAAS,UACL;Y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,IAAI,EAAE;QACvB,MAAM,WACJ,IAAI,CAAC,cAAc,KAAK,UAAU,cAAc;QAClD,MAAM,UAAU,IAAI,CAAC,eAAe,CAAC,SAAS;QAC9C,IAAI,KAAK,IAAI,YAAY,QAAQ,SAC/B,QAAQ;YAAE,CAAC,SAAS,EAAE,KLine truncated
|
||||
@@ -0,0 +1,584 @@
|
||||
export default class Upscaler {
|
||||
static DEFAULT_TIMEOUTS = { IMAGE: 300000, VIDEO: 3600000, METADATA: 10000 };
|
||||
static DEFAULT_DELAYS = { INIT: 500, NETWORK: 300 };
|
||||
|
||||
static isSupported() {
|
||||
try {
|
||||
const hasWorker = typeof Worker !== "undefined";
|
||||
const hasOffscreen =
|
||||
typeof OffscreenCanvas !== "undefined" ||
|
||||
(typeof document !== "undefined" &&
|
||||
!!document.createElement("canvas").transferControlToOffscreen);
|
||||
const hasBlob = typeof Blob !== "undefined";
|
||||
return hasWorker && hasOffscreen && hasBlob;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static isVideoSupported() {
|
||||
try {
|
||||
return (
|
||||
typeof VideoEncoder !== "undefined" &&
|
||||
typeof VideoDecoder !== "undefined"
|
||||
);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
constructor(options = {}) {
|
||||
const weightsBaseUrl = options.weightsBaseUrl || "/weights";
|
||||
|
||||
this.networks = options.networks || {
|
||||
small: {
|
||||
name: "anime4k/cnn-2x-l",
|
||||
weightsUrl: `${weightsBaseUrl}/cnn-8.json`,
|
||||
},
|
||||
medium: {
|
||||
name: "anime4k/cnn-2x-16",
|
||||
weightsUrl: `${weightsBaseUrl}/cnn-16.json`,
|
||||
},
|
||||
large: {
|
||||
name: "anime4k/cnn-2x-28",
|
||||
weightsUrl: `${weightsBaseUrl}/cnn-28.json`,
|
||||
},
|
||||
};
|
||||
|
||||
this.networkSize = options.networkSize || "medium";
|
||||
this.weightsBaseUrl = weightsBaseUrl;
|
||||
this.workerUrl = options.workerUrl || "/worker/main.js";
|
||||
|
||||
this.timeouts = {
|
||||
...Upscaler.DEFAULT_TIMEOUTS,
|
||||
...(options.timeouts || {}),
|
||||
};
|
||||
this.delays = { ...Upscaler.DEFAULT_DELAYS, ...(options.delays || {}) };
|
||||
|
||||
this.imageScale =
|
||||
typeof options.imageScale === "number" && options.imageScale > 0
|
||||
? options.imageScale
|
||||
: 2;
|
||||
this.videoScale =
|
||||
typeof options.videoScale === "number" && options.videoScale > 0
|
||||
? options.videoScale
|
||||
: 2;
|
||||
|
||||
this.weightsCache = new Map();
|
||||
this.workerInstance = null;
|
||||
this.messageHandlers = {};
|
||||
this.progressCallback = null;
|
||||
this.processingType = null;
|
||||
|
||||
this.realtimeLoopId = null;
|
||||
this.realtimeState = null;
|
||||
}
|
||||
|
||||
init({ prewarm = true } = {}) {
|
||||
if (!Upscaler.isSupported()) {
|
||||
throw new Error("Upscaler is not supported in this environment");
|
||||
}
|
||||
if (prewarm) {
|
||||
this.getWorker().postMessage({ cmd: "isSupported" });
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
getWorker() {
|
||||
if (!this.workerInstance) {
|
||||
this.workerInstance = new Worker(this.workerUrl);
|
||||
this.workerInstance.onmessage = (event) =>
|
||||
this.handleWorkerMessage(event);
|
||||
}
|
||||
return this.workerInstance;
|
||||
}
|
||||
|
||||
static extractProgressValue(data) {
|
||||
const value = data.data ?? data.progress ?? data.value ?? data.percentage;
|
||||
return typeof value === "number"
|
||||
? Math.min(100, Math.max(0, Math.round(value)))
|
||||
: null;
|
||||
}
|
||||
|
||||
handleBlobResponse(data) {
|
||||
const blobType =
|
||||
this.processingType === "video" ? "videoBlob" : "imageBlob";
|
||||
const handler = this.messageHandlers[blobType];
|
||||
if (data.data instanceof Blob && handler) {
|
||||
handler({ [blobType]: data.data });
|
||||
}
|
||||
}
|
||||
|
||||
requestBlob() {
|
||||
const cmd =
|
||||
this.processingType === "video" ? "getVideoBlob" : "getImageBlob";
|
||||
this.getWorker().postMessage({ cmd });
|
||||
}
|
||||
|
||||
handleWorkerMessage(event) {
|
||||
const { data } = event;
|
||||
if (!data.cmd) return;
|
||||
|
||||
const { cmd } = data;
|
||||
|
||||
if (cmd === "progress") {
|
||||
const progress = Upscaler.extractProgressValue(data);
|
||||
if (progress !== null && this.progressCallback) {
|
||||
this.progressCallback(progress);
|
||||
}
|
||||
if (this.messageHandlers.progress) this.messageHandlers.progress(data);
|
||||
} else if (cmd === "finished") {
|
||||
if (data.data instanceof Blob) {
|
||||
this.handleBlobResponse(data);
|
||||
} else {
|
||||
this.requestBlob();
|
||||
}
|
||||
} else if (this.messageHandlers[cmd]) {
|
||||
this.messageHandlers[cmd](data);
|
||||
}
|
||||
}
|
||||
|
||||
async loadWeights(networkSize) {
|
||||
this.validateNetworkSize(networkSize);
|
||||
if (this.weightsCache.has(networkSize)) {
|
||||
return this.weightsCache.get(networkSize);
|
||||
}
|
||||
const network = this.networks[networkSize];
|
||||
const response = await fetch(network.weightsUrl);
|
||||
if (!response.ok)
|
||||
throw new Error(`Failed to fetch weights: ${response.statusText}`);
|
||||
const weights = await response.json();
|
||||
this.weightsCache.set(networkSize, weights);
|
||||
return weights;
|
||||
}
|
||||
|
||||
static loadImageMetadata(arrayBuffer, mimeType) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const blob = new Blob([arrayBuffer], { type: mimeType });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const img = new Image();
|
||||
|
||||
img.onload = () => {
|
||||
URL.revokeObjectURL(url);
|
||||
resolve({ width: img.width, height: img.height });
|
||||
};
|
||||
|
||||
img.onerror = () => {
|
||||
URL.revokeObjectURL(url);
|
||||
reject(new Error("Failed to load image"));
|
||||
};
|
||||
|
||||
img.src = url;
|
||||
});
|
||||
}
|
||||
|
||||
static loadVideoMetadata(file, timeoutMs) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const url = URL.createObjectURL(file);
|
||||
const video = document.createElement("video");
|
||||
video.src = url;
|
||||
|
||||
const timeout = setTimeout(() => reject(new Error("Timeout")), timeoutMs);
|
||||
|
||||
video.onloadedmetadata = () => {
|
||||
clearTimeout(timeout);
|
||||
URL.revokeObjectURL(url);
|
||||
resolve({
|
||||
width: video.videoWidth,
|
||||
height: video.videoHeight,
|
||||
duration: video.duration,
|
||||
});
|
||||
};
|
||||
|
||||
video.onerror = () => {
|
||||
clearTimeout(timeout);
|
||||
URL.revokeObjectURL(url);
|
||||
reject(new Error("Failed to load video"));
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
createOffscreenCanvas(width, height, scale = 2) {
|
||||
const factor = typeof scale === "number" && scale > 0 ? scale : 1;
|
||||
const canvas = document.createElement("canvas");
|
||||
canvas.width = width * factor;
|
||||
canvas.height = height * factor;
|
||||
if (typeof canvas.transferControlToOffscreen !== "function") {
|
||||
throw new Error("OffscreenCanvas is not supported in this environment");
|
||||
}
|
||||
return canvas.transferControlToOffscreen();
|
||||
}
|
||||
|
||||
createBlobPromise(blobType, timeout) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const timeoutId = setTimeout(() => {
|
||||
if (this.messageHandlers[blobType]) {
|
||||
delete this.messageHandlers[blobType];
|
||||
reject(new Error(`${blobType} processing timeout`));
|
||||
}
|
||||
}, timeout);
|
||||
|
||||
this.messageHandlers[blobType] = (msg) => {
|
||||
delete this.messageHandlers[blobType];
|
||||
clearTimeout(timeoutId);
|
||||
const blob = msg[blobType] || msg.data;
|
||||
if (blob instanceof Blob) {
|
||||
resolve(blob);
|
||||
} else {
|
||||
reject(new Error(`Invalid ${blobType} format`));
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
validateNetworkSize(size) {
|
||||
if (!this.networks[size]) {
|
||||
throw new Error(
|
||||
"Invalid networkSize: use one of " +
|
||||
Object.keys(this.networks).join(", "),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async upscaleImage(imageFile, networkSize, scaleOverride) {
|
||||
if (!imageFile) throw new Error("Image file is required");
|
||||
const size = networkSize || this.networkSize;
|
||||
this.validateNetworkSize(size);
|
||||
|
||||
this.processingType = "image";
|
||||
const arrayBuffer = await imageFile.arrayBuffer();
|
||||
const mimeType = imageFile.type || "image/jpeg";
|
||||
const { width, height } = await Upscaler.loadImageMetadata(
|
||||
arrayBuffer,
|
||||
mimeType,
|
||||
);
|
||||
|
||||
|
||||
const weights = await this.loadWeights(size);
|
||||
const network = this.networks[size];
|
||||
const scale =
|
||||
typeof scaleOverride === "number" && scaleOverride > 0
|
||||
? scaleOverride
|
||||
: this.imageScale;
|
||||
const [canvasUp, canvasOrig] = [
|
||||
this.createOffscreenCanvas(width, height, scale),
|
||||
this.createOffscreenCanvas(width, height, 1),
|
||||
];
|
||||
|
||||
const blobPromise = this.createBlobPromise(
|
||||
"imageBlob",
|
||||
this.timeouts.IMAGE,
|
||||
);
|
||||
|
||||
this.getWorker().postMessage(
|
||||
{
|
||||
cmd: "init",
|
||||
data: {
|
||||
imageArrayBuffer: arrayBuffer,
|
||||
imageMimeType: mimeType,
|
||||
upscaled: canvasUp,
|
||||
original: canvasOrig,
|
||||
resolution: { width, height },
|
||||
network_name: network.name,
|
||||
weights,
|
||||
},
|
||||
},
|
||||
[canvasUp, canvasOrig],
|
||||
);
|
||||
|
||||
setTimeout(() => {
|
||||
this.getWorker().postMessage({
|
||||
cmd: "network",
|
||||
data: {
|
||||
name: network.name,
|
||||
imageArrayBuffer: arrayBuffer,
|
||||
imageMimeType: mimeType,
|
||||
weights,
|
||||
},
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
this.getWorker().postMessage({
|
||||
cmd: "getImageBlob",
|
||||
data: { imageArrayBuffer: arrayBuffer, imageMimeType: mimeType },
|
||||
});
|
||||
}, this.delays.NETWORK);
|
||||
}, this.delays.INIT);
|
||||
|
||||
return blobPromise;
|
||||
}
|
||||
|
||||
async upscaleVideo(videoFile, networkSize, scaleOverride) {
|
||||
if (!videoFile) throw new Error("Video file is required");
|
||||
const size = networkSize || this.networkSize;
|
||||
this.validateNetworkSize(size);
|
||||
|
||||
if (!Upscaler.isVideoSupported()) {
|
||||
throw new Error("WebCodecs API not supported. Requires Chrome 94+");
|
||||
}
|
||||
|
||||
this.processingType = "video";
|
||||
const { width, height, duration } = await Upscaler.loadVideoMetadata(
|
||||
videoFile,
|
||||
this.timeouts.METADATA,
|
||||
);
|
||||
|
||||
|
||||
const weights = await this.loadWeights(size);
|
||||
const network = this.networks[size];
|
||||
const scale =
|
||||
typeof scaleOverride === "number" && scaleOverride > 0
|
||||
? scaleOverride
|
||||
: this.videoScale;
|
||||
const [canvasOut, canvasIn] = [
|
||||
this.createOffscreenCanvas(width, height, scale),
|
||||
this.createOffscreenCanvas(width, height, 1),
|
||||
];
|
||||
|
||||
const blobPromise = this.createBlobPromise(
|
||||
"videoBlob",
|
||||
this.timeouts.VIDEO,
|
||||
);
|
||||
|
||||
this.getWorker().postMessage(
|
||||
{
|
||||
cmd: "process",
|
||||
file: videoFile,
|
||||
fileSize: videoFile.size,
|
||||
duration,
|
||||
adjustedResolution: {
|
||||
adjustedInputWidth: width,
|
||||
adjustedInputHeight: height,
|
||||
adjustedOutputWidth: width * scale,
|
||||
adjustedOutputHeight: height * scale,
|
||||
},
|
||||
upscaled: canvasOut,
|
||||
original: canvasIn,
|
||||
weights,
|
||||
network_name: network.name,
|
||||
skipDemuxProgress: true,
|
||||
},
|
||||
[canvasOut, canvasIn],
|
||||
);
|
||||
|
||||
return blobPromise;
|
||||
}
|
||||
|
||||
async startRealtimeUpscale(
|
||||
videoElement,
|
||||
canvasElement,
|
||||
networkSize,
|
||||
scaleOverride,
|
||||
) {
|
||||
if (!videoElement || !canvasElement) {
|
||||
throw new Error("videoElement and canvasElement are required");
|
||||
}
|
||||
|
||||
const size = networkSize || this.networkSize;
|
||||
this.validateNetworkSize(size);
|
||||
|
||||
const network = this.networks[size];
|
||||
const weights = await this.loadWeights(size);
|
||||
|
||||
const scale =
|
||||
typeof scaleOverride === "number" && scaleOverride > 0
|
||||
? scaleOverride
|
||||
: this.videoScale;
|
||||
|
||||
const ensureMetadata = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (videoElement.readyState >= 1) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
const onLoaded = () => {
|
||||
cleanup();
|
||||
resolve();
|
||||
};
|
||||
const onError = () => {
|
||||
cleanup();
|
||||
reject(new Error("Failed to load video metadata"));
|
||||
};
|
||||
const cleanup = () => {
|
||||
videoElement.removeEventListener("loadedmetadata", onLoaded);
|
||||
videoElement.removeEventListener("error", onError);
|
||||
};
|
||||
videoElement.addEventListener("loadedmetadata", onLoaded);
|
||||
videoElement.addEventListener("error", onError);
|
||||
});
|
||||
};
|
||||
|
||||
await ensureMetadata();
|
||||
|
||||
const width = videoElement.videoWidth;
|
||||
const height = videoElement.videoHeight;
|
||||
if (!width || !height) {
|
||||
throw new Error("Invalid video dimensions");
|
||||
}
|
||||
|
||||
|
||||
canvasElement.width = width * scale;
|
||||
canvasElement.height = height * scale;
|
||||
|
||||
if (typeof canvasElement.transferControlToOffscreen !== "function") {
|
||||
throw new Error("OffscreenCanvas is not supported in this environment");
|
||||
}
|
||||
|
||||
const offscreen = canvasElement.transferControlToOffscreen();
|
||||
|
||||
|
||||
if (this.realtimeLoopId) {
|
||||
cancelAnimationFrame(this.realtimeLoopId);
|
||||
this.realtimeLoopId = null;
|
||||
}
|
||||
|
||||
this.getWorker().postMessage(
|
||||
{
|
||||
cmd: "realtimeInit",
|
||||
data: {
|
||||
upscaled: offscreen,
|
||||
resolution: {
|
||||
width,
|
||||
height,
|
||||
scale,
|
||||
outputWidth: width * scale,
|
||||
outputHeight: height * scale,
|
||||
},
|
||||
network_name: network.name,
|
||||
weights,
|
||||
},
|
||||
},
|
||||
[offscreen],
|
||||
);
|
||||
|
||||
|
||||
this.realtimeState = {
|
||||
running: true,
|
||||
video: videoElement,
|
||||
canvas: canvasElement,
|
||||
scale,
|
||||
busy: false,
|
||||
frameIndex: 0,
|
||||
};
|
||||
|
||||
const loop = async () => {
|
||||
if (!this.realtimeState || !this.realtimeState.running) return;
|
||||
const state = this.realtimeState;
|
||||
const v = state.video;
|
||||
|
||||
if (!v.paused && !v.ended && !state.busy) {
|
||||
state.busy = true;
|
||||
try {
|
||||
const frame = await createImageBitmap(v);
|
||||
state.frameIndex += 1;
|
||||
|
||||
this.getWorker().postMessage(
|
||||
{
|
||||
cmd: "realtimeFrame",
|
||||
frame,
|
||||
},
|
||||
[frame],
|
||||
);
|
||||
} catch (e) {
|
||||
console.warn("realtimeFrame error", e);
|
||||
} finally {
|
||||
if (this.realtimeState) {
|
||||
this.realtimeState.busy = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.realtimeLoopId = requestAnimationFrame(loop);
|
||||
};
|
||||
|
||||
this.realtimeLoopId = requestAnimationFrame(loop);
|
||||
}
|
||||
|
||||
stopRealtimeUpscale() {
|
||||
if (this.realtimeLoopId) {
|
||||
cancelAnimationFrame(this.realtimeLoopId);
|
||||
this.realtimeLoopId = null;
|
||||
}
|
||||
if (this.realtimeState) {
|
||||
this.realtimeState.running = false;
|
||||
this.realtimeState = null;
|
||||
}
|
||||
}
|
||||
|
||||
async downloadUpscaled(file, networkSize, filename = null) {
|
||||
const isVideo = file.type.startsWith("video");
|
||||
const size = networkSize || this.networkSize;
|
||||
const blob = isVideo
|
||||
? await this.upscaleVideo(file, size)
|
||||
: await this.upscaleImage(file, size);
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download =
|
||||
filename || `upscaled_${Date.now()}.${isVideo ? "mp4" : "png"}`;
|
||||
link.click();
|
||||
URL.revokeObjectURL(url);
|
||||
return blob;
|
||||
}
|
||||
|
||||
getSupportedNetworks() {
|
||||
return Object.keys(this.networks);
|
||||
}
|
||||
|
||||
static async getGPUCapability() {
|
||||
try {
|
||||
if (navigator.gpu) {
|
||||
const adapter = await navigator.gpu.requestAdapter();
|
||||
if (adapter) {
|
||||
const buffer = adapter.limits.maxStorageBufferBindingSize / 512;
|
||||
const texture = 8192 * 8192;
|
||||
return Math.min(buffer, texture);
|
||||
}
|
||||
}
|
||||
const canvas = document.createElement("canvas");
|
||||
const gl = canvas.getContext("webgl2");
|
||||
if (gl) return gl.getParameter(gl.MAX_TEXTURE_SIZE) ** 2;
|
||||
return 8388608;
|
||||
} catch {
|
||||
return 8388608;
|
||||
}
|
||||
}
|
||||
|
||||
static getBackendType() {
|
||||
try {
|
||||
if (navigator.gpu) return "webgpu";
|
||||
if (document.createElement("canvas").getContext("webgl2")) return "webgl";
|
||||
return "unknown";
|
||||
} catch {
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
getAppState() {
|
||||
return {
|
||||
backend: Upscaler.getBackendType(),
|
||||
isProcessing: false,
|
||||
progress: 0,
|
||||
width: 0,
|
||||
height: 0,
|
||||
};
|
||||
}
|
||||
|
||||
onProgress(callback) {
|
||||
if (typeof callback === "function") {
|
||||
this.progressCallback = callback;
|
||||
}
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.stopRealtimeUpscale();
|
||||
if (this.workerInstance) {
|
||||
this.workerInstance.terminate();
|
||||
this.workerInstance = null;
|
||||
}
|
||||
this.messageHandlers = {};
|
||||
this.progressCallback = null;
|
||||
this.processingType = null;
|
||||
this.weightsCache.clear();
|
||||
}
|
||||
}
|
||||
@@ -1,434 +1,134 @@
|
||||
import WebSR from '@websr/websr';
|
||||
import Upscaler from "./Upscaler";
|
||||
|
||||
export default function artplayerPluginWebsr(option = {}) {
|
||||
export default function artplayerPluginWebsr(
|
||||
option = {
|
||||
networkSize: "medium",
|
||||
compare: false,
|
||||
},
|
||||
) {
|
||||
return (art) => {
|
||||
const {
|
||||
template: { $player },
|
||||
constructor: {
|
||||
validator,
|
||||
utils: { append, setStyles },
|
||||
},
|
||||
} = art;
|
||||
const { $video, $player } = art.template;
|
||||
|
||||
// Default options
|
||||
option = validator(
|
||||
{
|
||||
scale: 2,
|
||||
networkName: '',
|
||||
weights: null,
|
||||
compare: false,
|
||||
...option,
|
||||
},
|
||||
{
|
||||
scale: 'number',
|
||||
networkName: 'string',
|
||||
weights: '?string|object',
|
||||
compare: 'boolean',
|
||||
}
|
||||
);
|
||||
const $canvas = document.createElement("canvas");
|
||||
$player.appendChild($canvas);
|
||||
|
||||
// Validate required parameters
|
||||
if (!option.networkName) {
|
||||
console.error('WebSR: networkName is required');
|
||||
}
|
||||
if (!option.weights) {
|
||||
console.error('WebSR: weights is required');
|
||||
$canvas.style.position = "absolute";
|
||||
$canvas.style.zIndex = "11";
|
||||
$canvas.style.pointerEvents = "none";
|
||||
$canvas.style.top = "50%";
|
||||
$canvas.style.left = "50%";
|
||||
$canvas.style.transform = "translate(-50%, -50%)";
|
||||
|
||||
const upscaler = new Upscaler(option);
|
||||
upscaler.init();
|
||||
upscaler.startRealtimeUpscale($video, $canvas);
|
||||
|
||||
// 对比模式
|
||||
let comparePosition = 50;
|
||||
let isDragging = false;
|
||||
|
||||
// 创建对比手柄
|
||||
const $handler = document.createElement("div");
|
||||
$handler.style.position = "absolute";
|
||||
$handler.style.width = "3px";
|
||||
$handler.style.backgroundColor = "rgba(255, 255, 255, 0.5)";
|
||||
$handler.style.cursor = "ew-resize";
|
||||
$handler.style.zIndex = "12";
|
||||
$handler.style.pointerEvents = "auto";
|
||||
$handler.style.display = option.compare ? "block" : "none";
|
||||
$handler.style.boxShadow = "0 0 4px rgba(0, 0, 0, 0.1)";
|
||||
|
||||
if (option.compare) {
|
||||
$player.appendChild($handler);
|
||||
$handler.addEventListener("mousedown", handleMouseDown);
|
||||
document.addEventListener("mousemove", handleMouseMove);
|
||||
document.addEventListener("mouseup", handleMouseUp);
|
||||
updateCompareMask();
|
||||
}
|
||||
|
||||
let websr = null;
|
||||
let gpu = null;
|
||||
let isInitialized = false;
|
||||
let isEnabled = true; // Always enabled
|
||||
let renderFrameId = null;
|
||||
let comparePosition = 0.5; // Comparison split position (0-1)
|
||||
let isCompareDragging = false;
|
||||
|
||||
// Create canvas for upscaled output
|
||||
const $canvas = document.createElement('canvas');
|
||||
$canvas.id = 'artplayer-websr-canvas';
|
||||
setStyles($canvas, {
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
transform: 'translate(-50%, -50%)',
|
||||
display: 'block',
|
||||
pointerEvents: 'none',
|
||||
zIndex: '11',
|
||||
imageRendering: 'crisp-edges',
|
||||
});
|
||||
append($player, $canvas);
|
||||
|
||||
// Create comparison divider
|
||||
const $compareDivider = document.createElement('div');
|
||||
$compareDivider.id = 'artplayer-websr-divider';
|
||||
setStyles($compareDivider, {
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
transform: 'translate(-50%, -50%)',
|
||||
width: '2px',
|
||||
height: '100%',
|
||||
backgroundColor: '#fff',
|
||||
display: option.compare ? 'block' : 'none',
|
||||
pointerEvents: 'auto',
|
||||
cursor: 'col-resize',
|
||||
zIndex: '12',
|
||||
});
|
||||
append($player, $compareDivider);
|
||||
|
||||
// Function to update divider position and canvas clip-path
|
||||
function updateDividerPosition(pos) {
|
||||
comparePosition = Math.max(0, Math.min(1, pos));
|
||||
const offsetX = comparePosition * 100;
|
||||
setStyles($compareDivider, {
|
||||
left: offsetX + '%',
|
||||
});
|
||||
|
||||
// Update canvas clip-path to show only right side (upscaled)
|
||||
if (option.compare) {
|
||||
const clipPercent = comparePosition * 100;
|
||||
setStyles($canvas, {
|
||||
clipPath: `inset(0 0 0 ${clipPercent}%)`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Mouse events for comparison dragging
|
||||
document.addEventListener('mousemove', (e) => {
|
||||
if (!isCompareDragging) return;
|
||||
const rect = $player.getBoundingClientRect();
|
||||
const pos = (e.clientX - rect.left) / rect.width;
|
||||
updateDividerPosition(pos);
|
||||
});
|
||||
|
||||
document.addEventListener('mouseup', () => {
|
||||
isCompareDragging = false;
|
||||
});
|
||||
|
||||
$compareDivider.addEventListener('mousedown', () => {
|
||||
isCompareDragging = true;
|
||||
});
|
||||
|
||||
// Touch events for mobile
|
||||
document.addEventListener('touchmove', (e) => {
|
||||
if (!isCompareDragging) return;
|
||||
const rect = $player.getBoundingClientRect();
|
||||
const pos = (e.touches[0].clientX - rect.left) / rect.width;
|
||||
updateDividerPosition(pos);
|
||||
}, { passive: true });
|
||||
|
||||
document.addEventListener('touchend', () => {
|
||||
isCompareDragging = false;
|
||||
});
|
||||
|
||||
$compareDivider.addEventListener('touchstart', () => {
|
||||
isCompareDragging = true;
|
||||
});
|
||||
|
||||
// Function to calculate canvas size based on video aspect ratio
|
||||
function calcCanvasSize() {
|
||||
const videoElement = art.video;
|
||||
if (!videoElement) {
|
||||
return { displayWidth: 640, displayHeight: 360 };
|
||||
}
|
||||
|
||||
const containerWidth = $player.offsetWidth || 640;
|
||||
const containerHeight = $player.offsetHeight || 360;
|
||||
const videoWidth = videoElement.videoWidth || 640;
|
||||
const videoHeight = videoElement.videoHeight || 360;
|
||||
const aspectRatio = videoWidth / videoHeight;
|
||||
|
||||
let displayWidth = containerWidth;
|
||||
let displayHeight = containerHeight;
|
||||
|
||||
if (containerWidth / containerHeight > aspectRatio) {
|
||||
// Container is wider than video
|
||||
displayWidth = containerHeight * aspectRatio;
|
||||
} else {
|
||||
// Container is taller than video
|
||||
displayHeight = containerWidth / aspectRatio;
|
||||
}
|
||||
|
||||
return { displayWidth, displayHeight };
|
||||
}
|
||||
|
||||
// Initialize WebGPU and WebSR
|
||||
async function initWebSR() {
|
||||
try {
|
||||
if (isInitialized) return true;
|
||||
|
||||
// Check WebGPU support
|
||||
if (!navigator.gpu) {
|
||||
console.warn('WebGPU is not supported');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Initialize WebGPU
|
||||
gpu = await WebSR.initWebGPU();
|
||||
if (!gpu) {
|
||||
console.warn('Failed to initialize WebGPU');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Load weights
|
||||
let weights;
|
||||
if (typeof option.weights === 'string') {
|
||||
// If weights is a URL, fetch it
|
||||
const weightResponse = await fetch(option.weights);
|
||||
if (!weightResponse.ok) {
|
||||
console.warn(`Failed to load weights from ${option.weights}`);
|
||||
return false;
|
||||
}
|
||||
weights = await weightResponse.json();
|
||||
} else if (typeof option.weights === 'object') {
|
||||
// If weights is an object, use it directly
|
||||
weights = option.weights;
|
||||
} else {
|
||||
console.warn('Invalid weights format');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create WebSR instance
|
||||
const videoElement = art.video;
|
||||
if (!videoElement) {
|
||||
console.warn('Video element not found');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set canvas dimensions based on video aspect ratio
|
||||
function updateCompareMask() {
|
||||
if (option.compare) {
|
||||
const { displayWidth, displayHeight } = calcCanvasSize();
|
||||
$canvas.width = displayWidth * option.scale;
|
||||
$canvas.height = displayHeight * option.scale;
|
||||
setStyles($canvas, {
|
||||
width: displayWidth + 'px',
|
||||
height: displayHeight + 'px',
|
||||
});
|
||||
const gradient = `linear-gradient(to right, transparent 0%, transparent ${comparePosition}%, black ${comparePosition}%, black 100%)`;
|
||||
$canvas.style.maskImage = gradient;
|
||||
|
||||
websr = new WebSR({
|
||||
source: videoElement,
|
||||
network_name: option.networkName,
|
||||
weights: weights,
|
||||
gpu: gpu,
|
||||
canvas: $canvas,
|
||||
});
|
||||
const containerWidth = $player.offsetWidth || 640;
|
||||
const containerHeight = $player.offsetHeight || 360;
|
||||
const canvasLeft = (containerWidth - displayWidth) / 2;
|
||||
const canvasTop = (containerHeight - displayHeight) / 2;
|
||||
const handlerX =
|
||||
canvasLeft + (displayWidth * comparePosition) / 100;
|
||||
|
||||
isInitialized = true;
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error('WebSR initialization error:', error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Render single frame
|
||||
async function renderSingleFrame() {
|
||||
if (!websr || !isEnabled || !art.video) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await websr.render(art.video);
|
||||
} catch (error) {
|
||||
console.error('WebSR render error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Render frame function
|
||||
async function renderFrame() {
|
||||
if (!websr || !isEnabled || !art.video || art.video.paused) {
|
||||
renderFrameId = null;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await websr.render(art.video);
|
||||
} catch (error) {
|
||||
console.error('WebSR render error:', error);
|
||||
}
|
||||
|
||||
// Continue rendering
|
||||
if (isEnabled && !art.video.paused) {
|
||||
renderFrameId = requestAnimationFrame(renderFrame);
|
||||
}
|
||||
}
|
||||
|
||||
// Enable WebSR
|
||||
async function enable() {
|
||||
if (isEnabled) return;
|
||||
|
||||
if (!isInitialized) {
|
||||
const initialized = await initWebSR();
|
||||
if (!initialized) {
|
||||
console.error('Failed to initialize WebSR');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
isEnabled = true;
|
||||
setStyle($canvas, 'display', 'block');
|
||||
|
||||
// Start rendering if video is playing
|
||||
if (art.video && !art.video.paused) {
|
||||
renderFrameId = requestAnimationFrame(renderFrame);
|
||||
}
|
||||
|
||||
art.emit('artplayerPluginWebsr:enable');
|
||||
}
|
||||
|
||||
// Disable WebSR
|
||||
function disable() {
|
||||
if (!isEnabled) return;
|
||||
|
||||
isEnabled = false;
|
||||
setStyles($canvas, {
|
||||
display: 'none',
|
||||
});
|
||||
|
||||
// Cancel ongoing render
|
||||
if (renderFrameId) {
|
||||
cancelAnimationFrame(renderFrameId);
|
||||
renderFrameId = null;
|
||||
}
|
||||
|
||||
art.emit('artplayerPluginWebsr:disable');
|
||||
}
|
||||
|
||||
// Toggle WebSR
|
||||
async function toggle() {
|
||||
if (isEnabled) {
|
||||
disable();
|
||||
$handler.style.top = canvasTop + "px";
|
||||
$handler.style.left = handlerX + "px";
|
||||
$handler.style.height = displayHeight + "px";
|
||||
$handler.style.transform = "translateX(-50%)";
|
||||
} else {
|
||||
await enable();
|
||||
$canvas.style.maskImage = "none";
|
||||
}
|
||||
}
|
||||
|
||||
// Listen to video events
|
||||
art.on('play', () => {
|
||||
renderSingleFrame(); // Render current frame immediately
|
||||
if (isEnabled && isInitialized && !renderFrameId) {
|
||||
renderFrameId = requestAnimationFrame(renderFrame);
|
||||
function handleMouseDown(e) {
|
||||
if (option.compare) {
|
||||
isDragging = true;
|
||||
}
|
||||
}
|
||||
|
||||
function handleMouseMove(e) {
|
||||
if (option.compare && isDragging) {
|
||||
const rect = $player.getBoundingClientRect();
|
||||
const { displayWidth } = calcCanvasSize();
|
||||
const containerWidth = $player.offsetWidth || 640;
|
||||
const canvasLeft = (containerWidth - displayWidth) / 2;
|
||||
const x = e.clientX - rect.left;
|
||||
const relativeX = x - canvasLeft;
|
||||
comparePosition = (relativeX / displayWidth) * 100;
|
||||
comparePosition = Math.max(0, Math.min(100, comparePosition));
|
||||
updateCompareMask();
|
||||
}
|
||||
}
|
||||
|
||||
function handleMouseUp(e) {
|
||||
isDragging = false;
|
||||
}
|
||||
|
||||
art.on("destroy", () => {
|
||||
upscaler.dispose();
|
||||
$handler.removeEventListener("mousedown", handleMouseDown);
|
||||
document.removeEventListener("mousemove", handleMouseMove);
|
||||
document.removeEventListener("mouseup", handleMouseUp);
|
||||
});
|
||||
|
||||
art.on('pause', () => {
|
||||
if (renderFrameId) {
|
||||
cancelAnimationFrame(renderFrameId);
|
||||
renderFrameId = null;
|
||||
}
|
||||
art.on("resize", () => {
|
||||
const { displayWidth, displayHeight } = calcCanvasSize();
|
||||
$canvas.style.width = displayWidth + "px";
|
||||
$canvas.style.height = displayHeight + "px";
|
||||
updateCompareMask();
|
||||
});
|
||||
|
||||
art.on('seek', () => {
|
||||
if (isEnabled && isInitialized && !art.video.paused && !renderFrameId) {
|
||||
renderFrameId = requestAnimationFrame(renderFrame);
|
||||
}
|
||||
});
|
||||
|
||||
art.on('resize', () => {
|
||||
if (websr && $canvas.offsetParent) {
|
||||
const { displayWidth, displayHeight } = calcCanvasSize();
|
||||
$canvas.width = displayWidth * option.scale;
|
||||
$canvas.height = displayHeight * option.scale;
|
||||
setStyles($canvas, {
|
||||
width: displayWidth + 'px',
|
||||
height: displayHeight + 'px',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
art.on('destroy', () => {
|
||||
disable();
|
||||
if (renderFrameId) {
|
||||
cancelAnimationFrame(renderFrameId);
|
||||
renderFrameId = null;
|
||||
}
|
||||
if ($canvas.parentNode) {
|
||||
$canvas.parentNode.removeChild($canvas);
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize if enabled by default
|
||||
initWebSR().then(() => {
|
||||
// Render first frame after initialization
|
||||
if (isEnabled && isInitialized && art.video) {
|
||||
renderSingleFrame();
|
||||
}
|
||||
}).catch(err => console.error('Failed to init WebSR:', err));
|
||||
|
||||
// Return plugin API
|
||||
return {
|
||||
name: 'artplayerPluginWebsr',
|
||||
websr: () => websr,
|
||||
gpu: () => gpu,
|
||||
canvas: () => $canvas,
|
||||
enable,
|
||||
disable,
|
||||
toggle,
|
||||
isEnabled: () => isEnabled,
|
||||
isInitialized: () => isInitialized,
|
||||
// Comparison mode methods
|
||||
enableCompare: () => {
|
||||
option.compare = true;
|
||||
setStyles($compareDivider, { display: 'block' });
|
||||
updateDividerPosition(comparePosition);
|
||||
},
|
||||
disableCompare: () => {
|
||||
option.compare = false;
|
||||
setStyles($compareDivider, { display: 'none' });
|
||||
setStyles($canvas, { clipPath: 'none' });
|
||||
},
|
||||
toggleCompare: () => {
|
||||
if (option.compare) {
|
||||
setStyles($compareDivider, { display: 'none' });
|
||||
setStyles($canvas, { clipPath: 'none' });
|
||||
option.compare = false;
|
||||
} else {
|
||||
option.compare = true;
|
||||
setStyles($compareDivider, { display: 'block' });
|
||||
updateDividerPosition(comparePosition);
|
||||
}
|
||||
},
|
||||
setComparePosition: (pos) => {
|
||||
updateDividerPosition(pos);
|
||||
},
|
||||
getComparePosition: () => comparePosition,
|
||||
isComparing: () => option.compare,
|
||||
update: async (newOption) => {
|
||||
// Update weights and networkName (requires re-initialization)
|
||||
if ((newOption.weights !== undefined && newOption.weights !== option.weights) ||
|
||||
(newOption.networkName !== undefined && newOption.networkName !== option.networkName)) {
|
||||
// Update option values
|
||||
if (newOption.weights !== undefined) {
|
||||
option.weights = newOption.weights;
|
||||
}
|
||||
if (newOption.networkName !== undefined) {
|
||||
option.networkName = newOption.networkName;
|
||||
}
|
||||
// Mark as uninitialized to reload with new config
|
||||
isInitialized = false;
|
||||
// Reinitialize if enabled
|
||||
if (isEnabled) {
|
||||
await initWebSR();
|
||||
}
|
||||
}
|
||||
|
||||
// Update scale factor
|
||||
if (newOption.scale !== undefined && newOption.scale !== option.scale) {
|
||||
option.scale = newOption.scale;
|
||||
if ($canvas) {
|
||||
const { displayWidth, displayHeight } = calcCanvasSize();
|
||||
$canvas.width = displayWidth * option.scale;
|
||||
$canvas.height = displayHeight * option.scale;
|
||||
setStyles($canvas, {
|
||||
width: displayWidth + 'px',
|
||||
height: displayHeight + 'px',
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
name: "artplayerPluginWebsr",
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
if (typeof window !== "undefined") {
|
||||
window.artplayerPluginWebsr = artplayerPluginWebsr;
|
||||
}
|
||||
Reference in new issue
Block a user