Skip to content

Commit 2737fdf

Browse files
Merge pull request #59 from zhangzhuang15/dev
Dev
2 parents f1cbd9e + a35a2fd commit 2737fdf

25 files changed

+4811
-2853
lines changed

.vitepress/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ export default defineConfig({
344344
text: '接触cpp',
345345
link: '/blog/learning-cpp'
346346
},
347+
{
348+
text: 'learn zig',
349+
link: '/blog/learning-zig'
350+
},
347351
{
348352
text: 'rust编译出来的executable file比cpp大?',
349353
link: '/blog/rust-binary-is-big'
@@ -360,6 +364,10 @@ export default defineConfig({
360364
text: '协程-用C语言实现',
361365
link: '/blog/coroutine'
362366
},
367+
{
368+
text: 'Talk about pthread',
369+
link: '/blog/pthread'
370+
},
363371
{
364372
text: "使用vue遇到的一些坑",
365373
link: '/blog/vue-apply'
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<script setup lang="ts">
2+
import { onMounted, ref } from 'vue'
3+
import * as THREE from 'three'
4+
import Stats from 'three/addons/libs/stats.module.js'
5+
import { OrbitControls } from 'three/addons/controls/OrbitControls.js'
6+
import { OutlineEffect } from 'three/addons/effects/OutlineEffect.js'
7+
import { MMDLoader } from 'three/examples/jsm/loaders/MMDLoader.js';
8+
import "ammo.js"
9+
10+
const containerRef = ref<HTMLDivElement | null>(null)
11+
12+
onMounted(() => {
13+
function loadMMD(scene: THREE.Scene, camera: THREE.Camera) {
14+
const loader = new MMDLoader()
15+
16+
loader.load(
17+
"/models/hutao.pmx",
18+
async (mesh) => {
19+
mesh.position.y = -10
20+
const materials = mesh.material as THREE.Material[]
21+
materials.forEach(material => {
22+
material.lightMap = material.map
23+
material.lightMapIntensity = 5
24+
material.shininess = 10
25+
})
26+
27+
scene.add(mesh)
28+
29+
function animate() {
30+
requestAnimationFrame(animate)
31+
effect.render(scene, camera)
32+
}
33+
34+
animate()
35+
},
36+
async (xhr) => {
37+
console.log((xhr.loaded / xhr.total * 100) + '% loadedstore');
38+
},
39+
function (error) {
40+
console.log('An error happened');
41+
}
42+
)
43+
}
44+
45+
const camera = new THREE.PerspectiveCamera(
46+
45,
47+
containerRef.value!.offsetWidth / containerRef.value!.offsetHeight,
48+
1,
49+
2000
50+
)
51+
camera.position.z = 30
52+
53+
const scene = new THREE.Scene();
54+
55+
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.1)
56+
directionalLight.position.set(1, 1, 1).normalize()
57+
58+
scene.add(directionalLight)
59+
60+
const renderer = new THREE.WebGLRenderer({ antialias: true })
61+
renderer.setPixelRatio(window.devicePixelRatio)
62+
renderer.setSize(containerRef.value!.offsetWidth, containerRef.value!.offsetHeight)
63+
64+
containerRef.value!.appendChild(renderer.domElement)
65+
66+
const effect = new OutlineEffect(renderer)
67+
68+
const stats = new Stats()
69+
containerRef.value!.appendChild(stats.dom)
70+
71+
loadMMD(scene, camera)
72+
73+
const controls = new OrbitControls(camera, renderer.domElement)
74+
controls.minDistance = 10
75+
controls.maxDistance = 100
76+
})
77+
</script>
78+
79+
<template>
80+
<div ref="containerRef" class="model-container"></div>
81+
</template>
82+
83+
<style scoped>
84+
.model-container {
85+
width: 400px;
86+
height: 400px;
87+
margin: 0 auto;
88+
border: 1px solid #ccc;
89+
}
90+
</style>

.vitepress/theme/components/Home.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useData, useRouter } from "vitepress";
44
import { computed } from "vue";
55
import MusicIconButton from "./MusicIconButton.vue";
66
import MemoryBoard from "./MemoryBoard.vue";
7+
import CharacterModel from "./CharacterModel.vue";
78
89
const { isDark } = useData();
910
@@ -48,6 +49,10 @@ const visitBlog = () => go("/blog/index-page");
4849
</h3>
4950
</section>
5051

52+
<!-- <section class="gap-space">
53+
<CharacterModel />
54+
</section> -->
55+
5156
<section class="gap-space flex flex-evenly">
5257
<NButton
5358
type="primary"

docs/blog/ai-faq.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
title: "AI工具畅谈"
3+
page: true
4+
aside: true
5+
---
6+
7+
# AI工具畅谈
8+
9+
## 如何运用AI技术让视频更清晰
10+
4K修复动漫“大闹天宫” ?
11+
12+
4K修复经典老电影?
13+
14+
怎么做到的?
15+
16+
Take a look 👇
17+
18+
#### **推荐工具:**
19+
- **Topaz Video Enhance AI**
20+
- **简介**:专为视频增强设计的AI工具。支持将低分辨率视频提升到4K,并修复噪声和模糊。
21+
- **特点**
22+
- 支持批量处理。
23+
- 提供高质量的超分辨率重建。
24+
- 可以去除噪声并改善画质。
25+
- **适用性**:适合希望快速提升视频清晰度的用户。
26+
27+
- **GFox Video Enhancer AI**
28+
- **简介**:基于深度学习的视频增强工具,支持将低分辨率视频转换为4K。
29+
- **特点**
30+
- 支持多线程加速处理。
31+
- 可以修复压缩伪影(如块状效应)和噪声。
32+
- 提供多种预设模式,适合不同类型的视频。
33+
34+
- **Eltwise Upscale Pro**
35+
- **简介**:专注于视频超分辨率的AI工具,支持将视频提升到4K或更高分辨率。
36+
- **特点**
37+
- 支持逐帧处理和实时预览。
38+
- 提供高质量的锐化和降噪功能。
39+
- 可以修复低质量画面。
40+
41+
---
42+
43+
### **2. 使用深度学习模型**
44+
如果你有一定的技术背景,可以使用开源的深度学习模型来训练或部署视频增强模型。
45+
46+
#### **推荐模型:**
47+
- **EDSR(Enhanced Deep Residual Networks)**
48+
- **简介**:一种基于深度残差网络的超分辨率重建模型,广泛应用于图像和视频增强。
49+
- **特点**
50+
- 支持多种分辨率提升(如从720p到4K)。
51+
- 提供高质量的锐化和细节恢复。
52+
53+
- **RealESRGAN**
54+
- **简介**:基于GANS(生成对抗网络)的超分辨率模型,能够显著提高视频清晰度并修复噪声。
55+
- **特点**
56+
- 支持实时视频处理。
57+
- 可以去除压缩伪影和噪声。
58+
- 提供高质量的图像重建。
59+
60+
- **VSR(Video Super Resolution)**
61+
- **简介**:专门针对视频设计的超分辨率模型,支持逐帧处理并保持视频流畅度。
62+
- **特点**
63+
- 支持多种视频格式。
64+
- 可以修复低质量画面和模糊。
65+
66+
---
67+
68+
### **3. 使用在线工具**
69+
如果你不想下载软件或训练模型,可以尝试一些在线AI视频增强服务。
70+
71+
#### **推荐工具:**
72+
- **PimEyes AI Video Enhancer**
73+
- **简介**:一个基于AI的在线视频增强工具,支持将低分辨率视频提升到4K。
74+
- **特点**
75+
- 免费试用版本可用。
76+
- 支持批量处理。
77+
78+
- **DeOldify(部分功能)**
79+
- **简介**:主要用于视频老化和修复,但也可以用于清晰度提升。
80+
- **特点**
81+
- 提供免费在线服务。
82+
- 支持多种格式。
83+
84+
---
85+
86+
### **4. 使用视频编辑软件中的AI插件**
87+
一些专业的视频编辑软件集成了一些AI增强功能,可以用来提升视频清晰度。
88+
89+
#### **推荐工具:**
90+
- **Adobe Premiere Pro(与AI工具结合使用)**
91+
- **简介**: Adobe的视频编辑软件支持与外部AI工具(如Topaz Video Enhance AI)集成。
92+
- **特点**
93+
- 支持时间修复和细节增强。
94+
- 提供高质量的调色和修复功能。
95+
96+
- **DaVinci Resolve Studio**
97+
- **简介**:免费且强大的视频编辑软件,支持与外部AI工具结合使用。
98+
- **特点**
99+
- 提供降噪和锐化功能。
100+
- 支持超分辨率重建(需借助插件)。
101+
102+
---
103+
104+
### **5. 使用深度学习框架训练模型**
105+
如果你有技术背景,可以尝试使用开源的深度学习框架训练自己的视频增强模型。
106+
107+
#### **推荐框架:**
108+
- **TensorFlow**
109+
- **简介**:一个广泛使用的开源机器学习框架,支持自定义模型开发。
110+
- **特点**
111+
- 支持超分辨率重建任务。
112+
- 提供丰富的文档和社区支持。
113+
114+
- **PyTorch**
115+
- **简介**:另一个流行的深度学习框架,适合快速实验和模型部署。
116+
- **特点**
117+
- 支持动态计算图和灵活的模型设计。
118+
- 提供许多预训练模型可用于视频增强任务。
119+
120+
---
121+
122+
### **6. 注意事项**
123+
- **原始质量**:AI工具可以显著提升清晰度,但无法完全恢复丢失的细节。如果原始MP4文件质量非常低(如720p或更低
124+
),提升到4K的效果可能有限。
125+
- **处理时间**:视频增强是一个计算密集型任务,尤其是高分辨率视频,处理时间可能会较长。
126+
- **版权问题**:确保你处理的视频是你拥有权利的,避免侵犯他人版权。

docs/blog/css-new-feature.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: "css new feature"
3+
page: true
4+
aside: true
5+
---
6+
7+
# CSS New Feature
8+
9+
## align-content
10+
Set element at center of its container, replace old way:
11+
```css
12+
.center {
13+
display: flex;
14+
justify-content: center;
15+
align-items: center;
16+
}
17+
```
18+
19+
## `@property`
20+
Define custom property and use it with`var`
21+
22+
## `@starting-style`
23+
Avoid flash of unstyled content.
24+
25+
Flash of unstyled content: when page is loading, its style isn't loaded, it looks an unstyled page, then style loaded, it comes to styled page suddenly.
26+
27+
## round, mod, rem
28+
`calc` is the old css math method, now it brings `round`, `mod` and `rem`.
29+
30+
31+
## light-dark
32+
Replace the old way `@media (prefers-color-scheme: dark)`, it looks like:
33+
```css
34+
.main {
35+
background: light-dark(white, blue);
36+
}
37+
```
38+
Background is white in light mode, and blue in dark mode.
39+
40+
## `:user-valid` & `:user-invalid`
41+
Old way, `:valid` and `:invalid`, is triggered after page loaded. But new way,
42+
`:user-valid` and `:user-invalid` is triggered after user interacts with the field, e.g. `<input>` `<button>`.
43+
44+
## interpolate-size
45+
Animating sizes in CSS was limited, now we have `interpolate-size`, it looks like:
46+
```css
47+
.main {
48+
interpolate-size: height ease-in-out 3s;
49+
}
50+
```

0 commit comments

Comments
 (0)