Skip to content

Instantly share code, notes, and snippets.

如何编译支持ffmpeg和自编译的python的OpenCV

从源编译Python3

1.更新apt

建议换成国内源

sudo apt update
sudo apt upgrade

安装依赖

dpkg: error processing package nvidia-dkms-525(--configure):
 installed nvidia-dkms-525 package post-installation script subprocess returned error exit status 10

Examining the /var/lib/dkms/nvidia/525.78.01/build/make.log reveals multiple
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’

SOLVE:

sudo apt purge *nvidia* && sudo apt autoremove

HOME:Ctrl + A
END:Ctrl + E

  1. install Anaconda
  2. conda env -name your_env_name python=3.11
  3. conda activate your_env_name
  4. install git bash from official
  5. install visual build tools
https://github.com/bycloudai/InstallVSBuildToolsWindows

6.install torch torchaudio torchvision

Use another iso.
I use a new iso named "Ubuntu_23.10_live_server_arm64.iso"
Install desktop for it

sudo apt update
sudo apt install ubuntu-desktop
sudo dpkg --configure -a
sudo apt remove open-vm-tools
sudo apt install open-vm-tools-desktop
reboot

Image/Video Restoration

  1. PASD - make photo clearer, personalized styplization, colorization
    https://github.com/yangxy/PASD
  2. DA-CLIP - image dehazing(去雾), image deblurring, face inpainting(修复面部图像的缺陷), image desnowing(除雪), image shadow removal(图像去阴影), JPEG arifact deduction, low-light image enhancement,
    image denoising, image raindrop removal(玻璃上的雨滴去除), image deraining(图像中去除下雨)
    https://github.com/Algolzw/daclip-uir?tab=readme-ov-file
  3. SeeSR: Real-World Image Super-Resolution
    https://github.com/cswry/SeeSR
https://github.com/NVIDIA/MinkowskiEngine/issues/543
export MAX_JOBS=1
  1. Download Models
(1) pretrained diffusion denoising U-net and video variational autoencoder
https://connectpolyu-my.sharepoint.com/:f:/g/personal/19046191r_connect_polyu_hk/EvI_j1SUiVFBlwEy4i62ckgB1XEHeqfFcJS4Ho6JQrTAWA?e=rDT4M4
or
https://pan.baidu.com/s/1xQF996RsxnmN-60ZLB6Vig?pwd=gh4i

downloaded files:
mgldvsr_unet.ckpt
video_vae_cfw.ckpt