Total Pageviews

Sunday, 13 September 2026

ai-edu

 AI education materials for Chinese students, teachers and IT professionals.

https://microsoft.github.io/ai-edu/

微软人工智能教育与学习共建社区

微软人工智能教育与学习共建社区(Microsoft AI Education Community, 简称AI-Edu)是微软亚洲研究院(Microsoft Research Asia,简称MSRA)人工智能教育团队创立的人工智能开源社区。

本社区由基础教程实践案例实践项目三大模块构成,通过系统化的理论教程和丰富多样的实践案例,帮助学习者学习并掌握人工智能的知识,并锻炼在实际项目中的开发能力。

最新消息!

  • 2021年8月16日

    A6-人工智能系统 更新: A6-人工智能系统 课程已更新到最新版本!

    从即日起,人工智能系统开源课程做为本社区的子模块,与原始仓库保持同步更新。欢迎前来社区学习!

  • 2021年6月25日

    新版本发布:AI-Edu V1.3.0 已经发布啦!全新的社区架构,更加简洁方便!与之配套的网站也同步上线啦,欢迎大家前来体验!点此访问网站

  • 2021年6月21日

    案例更新:新的实践案例 基于LightGBM的时间序列预测 已上线,欢迎感兴趣的小伙伴前往学习。

  • 更新历史

目录功能一览

基础教程实践案例实践项目
内容
from  https://github.com/microsoft/ai-edu

libssh2-for-iOS

 A script for compiling libssh2 for iOS Devices (iPhone, iPad, iPod Touch). The example app can connect to an server with SSH and execute commands.

https://x2on.github.io/2011/02/02/libssh2-for-ios-iphone-and-ipad-example-app-with-ssh-connection/

Build Status

This is a tutorial for using self-compiled builds of the libssh2-library for iOS. You can build apps with XCode and the official SDK from Apple with this. I also made a small example-app for using the libraries with XCode and the iPhone/iPhone-Simulator.

@see: http://www.x2on.de/2011/02/02/libssh2-for-ios-iphone-and-ipad-example-app-with-ssh-connection/

The example uses libssh2 to make an ssh connection to an ssh server. Then you can execute commands on the server and get the output in your app.

You can build the libssh2 library with openssl or with libgcrypt!

Requirements:

  • Xcode 7.1
  • Xcode Command Line Tools

Readme

Checkout the submodules:

git submodule init
git submodule update

libssh2 with openssl:

./build-all.sh openssl

libssh2 with libgcrypt:

./build-all.sh libgcrypt

Solve problems:

Check the log files in the bin folder


from  https://github.com/x2on/libssh2-for-iOS

claw-code

 An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

start with the real crab-powered harnesses

github.com/code-yeongyu/lazycodex
github.com/Yeachan-Heo/gajae-code

Open LazyCodex on GitHub Open Gajae-Code on GitHub

Join the harness lab on Discord Join the crab tank on Discord

Join the Discords: ultraworkers discord · gajae-code discord

Important

Claw Code is not the serious production project here. This repository is closer to a museum exhibit than a product pitch, a crustacean-run artifact kept alive by clawed gajaes, swept and labeled by agents, and automatically maintained according to the harnesses above.

As already described in the project philosophy, this is not meant to be hand-operated like a normal product repo. It is an agent-managed exhibit: the harnesses plan, execute, verify, label, and preserve the artifact while the crabs keep the tank running.

If you want to actually run work, start with LazyCodex or Gajae-Code. If you want to inspect the strange little fossil of the Claw Code moment, continue below.

For the longer public explanation behind this philosophy, see here.

ultraworkers/claw-code · Usage · Rust workspace · Parity · Roadmap · Contributing · Security · UltraWorkers Discord

Claw Code is the public Rust implementation of the claw CLI agent harness. The canonical implementation lives in rust/, and the current source of truth for this repository is ultraworkers/claw-code.

Important

Start with USAGE.md for build, auth, CLI, session, and parity-harness workflows. For file submission/navigation questions, see Navigation and file context. For local OpenAI-compatible models and offline skill installs, see Local OpenAI-compatible providers and skills setup. Windows users can jump to the PowerShell-first Windows install and release quickstart. Make claw doctor your first health check after building, use rust/README.md for crate-level details, read PARITY.md for the current Rust-port checkpoint, and see docs/container.md for the container-first workflow.

ACP / Zed status: claw-code does not ship an ACP/Zed daemon or JSON-RPC entrypoint yet. Run claw acp (or claw --acp) for the current status instead of guessing from source layout; claw acp serve is currently a discoverability alias only, returns status with exit code 0, and real ACP support remains tracked separately in ROADMAP.md. For the public JSON contract, see docs/g011-acp-json-rpc-status-contract.md.

Current repository shape

  • rust/ — canonical Rust workspace and the claw CLI binary
  • USAGE.md — task-oriented usage guide for the current product surface
  • PARITY.md — Rust-port parity status and migration notes
  • ROADMAP.md — active roadmap and cleanup backlog
  • PHILOSOPHY.md — project intent and system-design framing
  • src/ + tests/ — companion Python/reference workspace and audit helpers; not the primary runtime surface

Quick start

Note

[!WARNING] cargo install claw-code installs the wrong thing. The claw-code crate on crates.io is a deprecated stub that places claw-code-deprecated.exe — not claw. Running it only prints "claw-code has been renamed to agent-code". Do not use cargo install claw-code. Either build from source (this repo) or install the upstream binary:

cargo install agent-code   # upstream binary — installs 'agent.exe' (Windows) / 'agent' (Unix), NOT 'agent-code'

This repo (ultraworkers/claw-code) is build-from-source only — follow the steps below.

# 1. Clone and build
git clone https://github.com/ultraworkers/claw-code
cd claw-code/rust
cargo build --workspace

# 2. Set your API key (Anthropic API key — not a Claude subscription)
export ANTHROPIC_API_KEY="sk-ant-..."

# 3. Verify everything is wired correctly
./target/debug/claw doctor

# 4. Run a prompt
./target/debug/claw prompt "say hello"

# 5. Start an interactive session
./target/debug/claw

Note

Windows (PowerShell): the binary is claw.exe, not claw. Use .\target\debug\claw.exe or run cargo run -- prompt "say hello" to skip the path lookup.

Windows setup

PowerShell is a supported Windows path. Use whichever shell works for you. The common onboarding issues on Windows are:

  1. Install Rust first — download from https://rustup.rs/ and run the installer. Close and reopen your terminal when it finishes.
  2. Verify Rust is on PATH:
    cargo --version
    If this fails, reopen your terminal or run the PATH setup from the Rust installer output, then retry.
  3. Clone and build (works in PowerShell, Git Bash, or WSL):
    git clone https://github.com/ultraworkers/claw-code
    cd claw-code/rust
    cargo build --workspace
  4. Run (PowerShell — note .exe and backslash):
    $env:ANTHROPIC_API_KEY = "sk-ant-..."
    .\target\debug\claw.exe prompt "say hello"

For release ZIPs, PATH setup, provider switching, and notification smoke checks, see docs/windows-install-release.md.

Git Bash / WSL are optional alternatives, not requirements. If you prefer bash-style paths (/c/Users/you/... instead of C:\Users\you\...), Git Bash (ships with Git for Windows) works well. In Git Bash, the MINGW64 prompt is expected and normal — not a broken install.

Post-build: locate the binary and verify

After running cargo build --workspace, the claw binary is built but not automatically installed to your system. Here's where to find it and how to verify the build succeeded.

Binary location

After cargo build --workspace in claw-code/rust/:

Debug build (default, faster compile):

  • macOS/Linux: rust/target/debug/claw
  • Windows: rust/target/debug/claw.exe

Release build (optimized, slower compile):

  • macOS/Linux: rust/target/release/claw
  • Windows: rust/target/release/claw.exe

If you ran cargo build without --release, the binary is in the debug/ folder.

Verify the build succeeded

Test the binary directly using its path:

# macOS/Linux (debug build)
./rust/target/debug/claw --help
./rust/target/debug/claw doctor

# Windows PowerShell (debug build)
.\rust\target\debug\claw.exe --help
.\rust\target\debug\claw.exe doctor

PowerShell smoke commands that do not require live credentials:

$env:CLAW_CONFIG_HOME = Join-Path $env:TEMP "claw config home"
New-Item -ItemType Directory -Force -Path $env:CLAW_CONFIG_HOME | Out-Null
Remove-Item Env:\ANTHROPIC_API_KEY, Env:\ANTHROPIC_AUTH_TOKEN, Env:\OPENAI_API_KEY -ErrorAction SilentlyContinue
.\rust\target\debug\claw.exe help
.\rust\target\debug\claw.exe status
.\rust\target\debug\claw.exe config env
.\rust\target\debug\claw.exe doctor

If these commands succeed, the build is working. claw doctor is your first health check — it validates your API key, model access, and tool configuration.

Optional: Add to PATH

If you want to run claw from any directory without the full path, choose one of these approaches:

Option 1: Symlink (macOS/Linux)

ln -s $(pwd)/rust/target/debug/claw /usr/local/bin/claw

Then reload your shell and test:

claw --help

Option 2: Use cargo install (all platforms)

Build and install to Cargo's default location (~/.cargo/bin/, which is usually on PATH):

# From the claw-code/rust/ directory
cargo install --path . --force

# Then from anywhere
claw --help

Option 3: Update shell profile (bash/zsh)

Add this line to ~/.bashrc or ~/.zshrc:

export PATH="$(pwd)/rust/target/debug:$PATH"

Reload your shell:

source ~/.bashrc  # or source ~/.zshrc
claw --help

Troubleshooting

  • "command not found: claw" — The binary is in rust/target/debug/claw, but it's not on your PATH. Use the full path ./rust/target/debug/claw or symlink/install as above.
  • "permission denied" — On macOS/Linux, you may need chmod +x rust/target/debug/claw if the executable bit isn't set (rare).
  • Debug vs. release — If the build is slow, you're in debug mode (default). Add --release to cargo build for faster runtime, but the build itself will take 5–10 minutes.

Note

Auth: claw requires an API key (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) — Claude subscription login is not a supported auth path.

Run the workspace test suite after verifying the binary works:

cd rust
cargo test --workspace

Documentation map

Ecosystem

Claw Code is built in the open alongside the broader UltraWorkers toolchain:

from  https://github.com/ultraworkers/claw-code

AIMedia

 AIMedia 是一款自动抓取热点,AI创作文章,自动发布的集成软件。支持头条,小红书,公众号等.

全新架构:Django 后端 + PySide6 桌面端,提供企业级稳定性和优秀的用户体验

⚠️ 重要说明

本项目为工程级重量项目,包含完整的 Django 后端服务、PySide6 桌面客户端,并集成了微信支付、登录等企业级功能。

使用本项目需要:

  • 自行部署 Django 后端服务
  • 打包 PySide6 桌面应用
  • 配置数据库、支付接口等复杂环境

插件版本爬虫自取:AiMaster

我们正在开发更轻量、更稳定的新版本,采用:

  • FastAPI 后端(替代 Django,更轻量)
  • 浏览器插件 客户端(无需打包,开箱即用)
  • 公众号 API 直接调用(更稳定可靠)

🎉 新版本MediaFlow已经发布 官网链接 B站介绍B站链接

只对爬虫感兴趣的开发者可以直接看 article-spider

项目架构 

本项目采用前后端分离的架构设计,由两个主要部分组成:

后端服务 - Django (back/)

  • 提供 RESTful API 接口
  • 数据库管理与持久化
  • 任务调度与自动化执行
  • 热点新闻抓取服务
  • AI 内容生成引擎
  • 多平台发布管理

前端应用 - PySide6 (pyside/)

  • 直观的图形用户界面
  • 本地任务管理
  • 实时数据监控
  • 配置管理面板
  • 跨平台桌面应用

技术栈

  • 后端: Django 5.x + Django REST Framework
  • 前端: PySide6 (Qt for Python)
  • 数据库: SQLite / PostgreSQL / MySQL
  • AI: 智谱 AI + Stable Diffusion
  • 自动化: Selenium + Chrome

功能特性 

热点新闻抓取

  • 抖音热点
  • 网易新闻
  • 微博热点
  • 澎湃新闻
  • 中国日报
  • 搜狐新闻

AI 智能创作

  • 基于热点新闻的 AI 自动创作
  • AI 图像生成(增加原创率)
  • 多平台内容适配

多平台发布

  • 今日头条
  • 企鹅号
  • 微信公众号
  • 百家号

系统管理

  • Django 后台管理系统
  • PySide6 桌面客户端
  • 任务调度与监控
  • 配置管理
  • 微信支付集成
  • 微信登录集成

⚠️ 部署说明

本项目为工程级重量项目,不适合开箱即用。使用前请充分了解以下要求:

技术门槛

  • 需要具备 Django 项目部署经验
  • 需要了解 PySide6 应用打包流程
  • 需要配置微信支付、登录等第三方接口
  • 需要自行搭建和维护数据库服务

部署工作量

  • 后端部署:Django 服务器配置、数据库迁移、环境变量配置等
  • 前端打包:PySide6 应用编译、依赖打包、图标资源等
  • 接口配置:微信支付商户号、应用密钥、回调地址等
  • 运维维护:日志监控、错误处理、版本更新等

后期计划 

注意:本项目(AIMedia)作为工程级版本,后续维护将以稳定性为主。

新功能开发已迁移至更轻量的新版本 AiMaster,采用 FastAPI + 浏览器插件架构,更易部署和使用。

  • 自动生成视频并发布各个平台(将在 AiMaster 中实现)
  • 移动端应用开发(将在 AiMaster 中实现)
  • 更多平台接入(将在 AiMaster 中实现)
  • Bug 修复和稳定性维护

配置要求 

硬件要求

  • CPU: 4核或以上
  • 内存: 8GB 或以上
  • 硬盘: 10GB 可用空间
  • 显卡: 非必须(AI 配图功能建议有独显)

软件要求

  • Windows 10 或以上
  • Python 3.12.4
  • Chrome 浏览器(自动化发布需要)

快速开始 

前提条件

  • 尽量不要使用 中文路径,避免出现一些无法预料的问题
  • 请确保你的 网络 是正常的,VPN 需要打开全局流量模式

1. 克隆代码

git clone https://github.com/Anning01/AIMedia
cd AIMedia

2. 创建虚拟环境

使用 Conda(推荐)

conda create -n AIMedia python=3.12.4
conda activate AIMedia
pip install -r requirements.txt

使用 venv

python -m venv venv
# Windows
.\venv\Scripts\activate
# Linux/Mac
source venv/bin/activate

pip install -r requirements.txt

3. 下载 Chrome 浏览器(自动发布功能需要)

下载地址:

下载后解压,整个目录放到 .\AIMedia\pyside 里面,最终的文件路径应该是这样: .\AIMedia\pyside\chrome

4. 启动项目

请分别查看后端和前端的说明文档:

项目结构:

AIMedia/
├── back/                   # Django 后端
│   ├── manage.py          # Django 管理脚本
│   ├── config/            # 项目配置
│   ├── apps/              # 应用模块
│   └── ...
├── pyside/                # PySide6 前端
│   ├── main.py            # 主入口
│   ├── ui/                # UI 界面
│   ├── utils/             # 工具函数
│   └── ...
├── docs/                  # 文档资源
├── config.py              # 配置文件模板
├── requirements.txt       # Python 依赖
├── LICENSE                # 许可证
└── README.md              # 项目说明

 from https://github.com/Anning01/AIMedia

视频演示 :

B站视频链接:https://www.bilibili.com/video/BV1Xkw1zMEP7

交流讨论:

DeOldify

 A Deep Learning based project for colorizing and restoring old images (and video!)

This Reposisitory is Archived This project was a wild ride since I started it back in 2018. 6 years ago as of this writing (October 19, 2024)!. It's time for me to move on and put this repo in the archives as I simply don't have the time to attend to it anymore, and frankly it's ancient as far as deep-learning projects go at this point! ~Jason

Quick Start: The easiest way to colorize images using open source DeOldify (for free!) is here: DeOldify Image Colorization on DeepAI

Desktop: Want to run open source DeOldify for photos and videos on the desktop?

In Browser (new!) Check out this Onnx-based in browser implementation: https://github.com/akbartus/DeOldify-on-Browser

The most advanced version of DeOldify image colorization is available here, exclusively. Try a few images for free! MyHeritage In Color

Replicate: Image: | Video:


Image (artistic) Colab for images | Video Colab for video

Having trouble with the default image colorizer, aka "artistic"? Try the "stable" one below. It generally won't produce colors that are as interesting as "artistic", but the glitches are noticeably reduced.

Image (stable) Colab for stable model

Instructions on how to use the Colabs above have been kindly provided in video tutorial form by Old Ireland in Colour's John Breslin. It's great! Click video image below to watch.

DeOldify Tutorial

Get more updates on Twitter Twitter logo.

Table of Contents

About DeOldify

Simply put, the mission of this project is to colorize and restore old images and film footage. We'll get into the details in a bit, but first let's see some pretty pictures and videos!

New and Exciting Stuff in DeOldify

  • Glitches and artifacts are almost entirely eliminated
  • Better skin (less zombies)
  • More highly detailed and photorealistic renders
  • Much less "blue bias"
  • Video - it actually looks good!
  • NoGAN - a new and weird but highly effective way to do GAN training for image to image.

Example Videos

Note: Click images to watch

Facebook F8 Demo

DeOldify Facebook F8 Movie Colorization Demo

Silent Movie Examples

DeOldify Silent Movie Examples

Example Images

"Migrant Mother" by Dorothea Lange (1936)

Migrant Mother

Woman relaxing in her livingroom in Sweden (1920)

Sweden Living Room

"Toffs and Toughs" by Jimmy Sime (1937)

Class Divide

Thanksgiving Maskers (1911)

Thanksgiving Maskers

Glen Echo Madame Careta Gypsy Camp in Maryland (1925)

Gypsy Camp

"Mr. and Mrs. Lemuel Smith and their younger children in their farm house, Carroll County, Georgia." (1941)

Georgia Farmhouse

"Building the Golden Gate Bridge" (est 1937)

Golden Gate Bridge

Note: What you might be wondering is while this render looks cool, are the colors accurate? The original photo certainly makes it look like the towers of the bridge could be white. We looked into this and it turns out the answer is no - the towers were already covered in red primer by this time. So that's something to keep in mind- historical accuracy remains a huge challenge!

"Terrasse de café, Paris" (1925)

Cafe Paris

Norwegian Bride (est late 1890s)

Norwegian Bride

Zitkála-Šá (Lakota: Red Bird), also known as Gertrude Simmons Bonnin (1898)

Native Woman

Chinese Opium Smokers (1880)

Opium Real

Stuff That Should Probably Be In A Paper

How to Achieve Stable Video

NoGAN training is crucial to getting the kind of stable and colorful images seen in this iteration of DeOldify. NoGAN training combines the benefits of GAN training (wonderful colorization) while eliminating the nasty side effects (like flickering objects in video). Believe it or not, video is rendered using isolated image generation without any sort of temporal modeling tacked on. The process performs 30-60 minutes of the GAN portion of "NoGAN" training, using 1% to 3% of imagenet data once. Then, as with still image colorization, we "DeOldify" individual frames before rebuilding the video.

In addition to improved video stability, there is an interesting thing going on here worth mentioning. It turns out the models I run, even different ones and with different training structures, keep arriving at more or less the same solution. That's even the case for the colorization of things you may think would be arbitrary and unknowable, like the color of clothing, cars, and even special effects (as seen in "Metropolis").

My best guess is that the models are learning some interesting rules about how to colorize based on subtle cues present in the black and white images that I certainly wouldn't expect to exist. This result leads to nicely deterministic and consistent results, and that means you don't have track model colorization decisions because they're not arbitrary. Additionally, they seem remarkably robust so that even in moving scenes the renders are very consistent.

Other ways to stabilize video add up as well. First, generally speaking rendering at a higher resolution (higher render_factor) will increase stability of colorization decisions. This stands to reason because the model has higher fidelity image information to work with and will have a greater chance of making the "right" decision consistently. Closely related to this is the use of resnet101 instead of resnet34 as the backbone of the generator- objects are detected more consistently and correctly with this. This is especially important for getting good, consistent skin rendering. It can be particularly visually jarring if you wind up with "zombie hands", for example.

Additionally, gaussian noise augmentation during training appears to help but at this point the conclusions as to just how much are bit more tenuous (I just haven't formally measured this yet). This is loosely based on work done in style transfer video, described here: https://medium.com/element-ai-research-lab/stabilizing-neural-style-transfer-for-video-62675e203e42.

Special thanks go to Rani Horev for his contributions in implementing this noise augmentation.

What is NoGAN?

This is a new type of GAN training that I've developed to solve some key problems in the previous DeOldify model. It provides the benefits of GAN training while spending minimal time doing direct GAN training. Instead, most of the training time is spent pretraining the generator and critic separately with more straight-forward, fast and reliable conventional methods. A key insight here is that those more "conventional" methods generally get you most of the results you need, and that GANs can be used to close the gap on realism. During the very short amount of actual GAN training the generator not only gets the full realistic colorization capabilities that used to take days of progressively resized GAN training, but it also doesn't accrue nearly as much of the artifacts and other ugly baggage of GANs. In fact, you can pretty much eliminate glitches and artifacts almost entirely depending on your approach. As far as I know this is a new technique. And it's incredibly effective.

Original DeOldify Model

NoGAN-Based DeOldify Model

The steps are as follows: First train the generator in a conventional way by itself with just the feature loss. Next, generate images from that, and train the critic on distinguishing between those outputs and real images as a basic binary classifier. Finally, train the generator and critic together in a GAN setting (starting right at the target size of 192px in this case). Now for the weird part: All the useful GAN training here only takes place within a very small window of time. There's an inflection point where it appears the critic has transferred everything it can that is useful to the generator. Past this point, image quality oscillates between the best that you can get at the inflection point, or bad in a predictable way (orangish skin, overly red lips, etc). There appears to be no productive training after the inflection point. And this point lies within training on just 1% to 3% of the Imagenet Data! That amounts to about 30-60 minutes of training at 192px.

The hard part is finding this inflection point. So far, I've accomplished this by making a whole bunch of model save checkpoints (every 0.1% of data iterated on) and then just looking for the point where images look great before they go totally bonkers with orange skin (always the first thing to go). Additionally, generator rendering starts immediately getting glitchy and inconsistent at this point, which is no good particularly for video. What I'd really like to figure out is what the tell-tale sign of the inflection point is that can be easily automated as an early stopping point. Unfortunately, nothing definitive is jumping out at me yet. For one, it's happening in the middle of training loss decreasing- not when it flattens out, which would seem more reasonable on the surface.

Another key thing about NoGAN training is you can repeat pretraining the critic on generated images after the initial GAN training, then repeat the GAN training itself in the same fashion. This is how I was able to get extra colorful results with the "artistic" model. But this does come at a cost currently- the output of the generator becomes increasingly inconsistent and you have to experiment with render resolution (render_factor) to get the best result. But the renders are still glitch free and way more consistent than I was ever able to achieve with the original DeOldify model. You can do about five of these repeat cycles, give or take, before you get diminishing returns, as far as I can tell.

Keep in mind- I haven't been entirely rigorous in figuring out what all is going on in NoGAN- I'll save that for a paper. That means there's a good chance I'm wrong about something. But I think it's definitely worth putting out there now because I'm finding it very useful- it's solving basically much of my remaining problems I had in DeOldify.

This builds upon a technique developed in collaboration with Jeremy Howard and Sylvain Gugger for Fast.AI's Lesson 7 in version 3 of Practical Deep Learning for Coders Part I. The particular lesson notebook can be found here: https://github.com/fastai/course-v3/blob/master/nbs/dl1/lesson7-superres-gan.ipynb

Why Three Models?

There are now three models to choose from in DeOldify. Each of these has key strengths and weaknesses, and so have different use cases. Video is for video of course. But stable and artistic are both for images, and sometimes one will do images better than the other.

More details:

  • Artistic - This model achieves the highest quality results in image coloration, in terms of interesting details and vibrance. The most notable drawback however is that it's a bit of a pain to fiddle around with to get the best results (you have to adjust the rendering resolution or render_factor to achieve this). Additionally, the model does not do as well as stable in a few key common scenarios- nature scenes and portraits. The model uses a resnet34 backbone on a UNet with an emphasis on depth of layers on the decoder side. This model was trained with 5 critic pretrain/GAN cycle repeats via NoGAN, in addition to the initial generator/critic pretrain/GAN NoGAN training, at 192px. This adds up to a total of 32% of Imagenet data trained once (12.5 hours of direct GAN training).

  • Stable - This model achieves the best results with landscapes and portraits. Notably, it produces less "zombies"- where faces or limbs stay gray rather than being colored in properly. It generally has less weird miscolorations than artistic, but it's also less colorful in general. This model uses a resnet101 backbone on a UNet with an emphasis on width of layers on the decoder side. This model was trained with 3 critic pretrain/GAN cycle repeats via NoGAN, in addition to the initial generator/critic pretrain/GAN NoGAN training, at 192px. This adds up to a total of 7% of Imagenet data trained once (3 hours of direct GAN training).

  • Video - This model is optimized for smooth, consistent and flicker-free video. This would definitely be the least colorful of the three models, but it's honestly not too far off from "stable". The model is the same as "stable" in terms of architecture, but differs in training. It's trained for a mere 2.2% of Imagenet data once at 192px, using only the initial generator/critic pretrain/GAN NoGAN training (1 hour of direct GAN training).

Because the training of the artistic and stable models was done before the "inflection point" of NoGAN training described in "What is NoGAN???" was discovered, I believe this amount of training on them can be knocked down considerably. As far as I can tell, the models were stopped at "good points" that were well beyond where productive training was taking place. I'll be looking into this in the future.

Ideally, eventually these three models will be consolidated into one that has all these good desirable unified. I think there's a path there, but it's going to require more work! So for now, the most practical solution appears to be to maintain multiple models.

The Technical Details

This is a deep learning based model. More specifically, what I've done is combined the following approaches:

Except the generator is a pretrained U-Net, and I've just modified it to have the spectral normalization and self-attention. It's a pretty straightforward translation.

This is also very straightforward – it's just one to one generator/critic iterations and higher critic learning rate. This is modified to incorporate a "threshold" critic loss that makes sure that the critic is "caught up" before moving on to generator training. This is particularly useful for the "NoGAN" method described below.

NoGAN

There's no paper here! This is a new type of GAN training that I've developed to solve some key problems in the previous DeOldify model. The gist is that you get the benefits of GAN training while spending minimal time doing direct GAN training. More details are in the What is NoGAN? section (it's a doozy).

Generator Loss

Loss during NoGAN learning is two parts: One is a basic Perceptual Loss (or Feature Loss) based on VGG16 – this just biases the generator model to replicate the input image. The second is the loss score from the critic. For the curious – Perceptual Loss isn't sufficient by itself to produce good results. It tends to just encourage a bunch of brown/green/blue – you know, cheating to the test, basically, which neural networks are really good at doing! Key thing to realize here is that GANs essentially are learning the loss function for you – which is really one big step closer to toward the ideal that we're shooting for in machine learning. And of course you generally get much better results when you get the machine to learn something you were previously hand coding. That's certainly the case here.

Of note: There's no longer any "Progressive Growing of GANs" type training going on here. It's just not needed in lieu of the superior results obtained by the "NoGAN" technique described above.

The beauty of this model is that it should be generally useful for all sorts of image modification, and it should do it quite well. What you're seeing above are the results of the colorization model, but that's just one component in a pipeline that I'm developing with the exact same approach.

This Project, Going Forward

So that's the gist of this project – I'm looking to make old photos and film look reeeeaaally good with GANs, and more importantly, make the project useful. In the meantime though this is going to be my baby and I'll be actively updating and improving the code over the foreseeable future. I'll try to make this as user-friendly as possible, but I'm sure there's going to be hiccups along the way.

Oh and I swear I'll document the code properly...eventually. Admittedly I'm one of those people who believes in "self documenting code" (LOL).

Getting Started Yourself

Easiest Approach

The easiest way to get started is to go straight to the Colab notebooks:

Image Colab for images | Video Colab for video

Special thanks to Matt Robinson and María Benavente for their image Colab notebook contributions, and Robert Bell for the video Colab notebook work!

Your Own Machine (not as easy)

Hardware and Operating System Requirements

  • (Training Only) BEEFY Graphics card. I'd really like to have more memory than the 11 GB in my GeForce 1080TI (11GB). You'll have a tough time with less. The Generators and Critic are ridiculously large.
  • (Colorization Alone) A decent graphics card. Approximately 4GB+ memory video cards should be sufficient.
  • Linux. I'm using Ubuntu 18.04, and I know 16.04 works fine too. Windows is not supported and any issues brought up related to this will not be investigated.

Easy Install

You should now be able to do a simple install with Anaconda. Here are the steps:

Open the command line and navigate to the root folder you wish to install. Then type the following commands

git clone https://github.com/jantic/DeOldify.git DeOldify
cd DeOldify
conda env create -f environment.yml

Then start running with these commands:

source activate deoldify
jupyter lab

From there you can start running the notebooks in Jupyter Lab, via the url they provide you in the console.

Note: You can also now do "conda activate deoldify" if you have the latest version of conda and in fact that's now recommended. But a lot of people don't have that yet so I'm not going to make it the default instruction here yet.

Alternative Install: User daddyparodz has kindly created an installer script for Ubuntu, and in particular Ubuntu on WSL, that may make things easier: https://github.com/daddyparodz/AutoDeOldifyLocal

Note on test_images Folder

The images in the test_images folder have been removed because they were using Git LFS and that costs a lot of money when GitHub actually charges for bandwidth on a popular open source project (they had a billing bug for while that was recently fixed). The notebooks that use them (the image test ones) still point to images in that directory that I (Jason) have personally and I'd like to keep it that way because, after all, I'm by far the primary and most active developer. But they won't work for you. Still, those notebooks are a convenient template for making your own tests if you're so inclined.

Typical training

The notebook ColorizeTrainingWandb has been created to log and monitor results through Weights & Biases. You can find a description of typical training by consulting W&B Report.

Pretrained Weights

To start right away on your own machine with your own images or videos without training the models yourself, you'll need to download the "Completed Generator Weights" listed below and drop them in the /models/ folder.

The colorization inference notebooks should be able to guide you from here. The notebooks to use are named ImageColorizerArtistic.ipynb, ImageColorizerStable.ipynb, and VideoColorizer.ipynb.

Completed Generator Weights

Completed Critic Weights

Pretrain Only Generator Weights

Pretrain Only Critic Weights

Want the Old DeOldify?

We suspect some of you are going to want access to the original DeOldify model for various reasons. We have that archived here: https://github.com/dana-kelley/DeOldify

from  https://github.com/jantic/DeOldify