2xAoMR_mosr / README.md
Phips's picture
Update README.md
3a8aef5 verified
metadata
license: cc-by-4.0
pipeline_tag: image-to-image
tags:
  - pytorch
  - super-resolution

Link to Github Release

2xAoMR_mosr

Scale: 4
Architecture: MoSR
Architecture Option: mosr

Author: Philip Hofmann
License: CC-BY-0.4
Purpose: A 2x mosr upscaling model for game textures
Subject: Game Textures
Input Type: Images
Release Date: 21.09.2024 (dd/mm/yy)

Dataset: Game Textures from Age of Mythology: Retold
Dataset Size: 13'847
OTF (on the fly augmentations): No
Pretrained Model: 4xNomos2_hq_mosr
Iterations: 510'000
Batch Size: 4
Patch Size: 64

Description:

In short: A 2x game texture mosr upscaling model, trained on and for (but not limited to) Age of Mythology: Retold textures.

Since I have been playing Age of Mythology: Retold (casual player), I thought it would be interesting to train an single image super resolution model on (and for) game textures of AoMR, but this model should be usable for other game textures aswell.
This is a 2x model, since the biggest texture images are already 4096x4096, I thought going 4x on those would be overkill (also there are already 4x game texture upscaling models, so this model can be used for similiar cases where 4x is not needed).

The pth, a static onnx conversion (since dysample used), and the training config files are provided in the Assets.

Model Showcase:

Slowpics

(Click on image for better view) Example1 Example2 Example3 Example4

Process:

After extracting all the game's .bar files: image

I ended up with 9067 textures files, which I tiled into 13'847 512x512px tiles, so the hr kinda looks like this (containing basecolor, normals, masks, etc): hr

I then created a corresponding lr folder by using gaussian blur, quantization (floyd_steinberg, jarvis_judice_ninke, stucki, atkinson, burkes, sierra, two_row_sierra, sierra_lite) , compression (jpg), downscaling (down_up, linear, cubic_mitchell, lanczos, gauss, box), and then later on added bc1 compression (based on kim's suggestion, which improved the quality of this model) using nvcompress.

I trained a mosr model for 550k iterations, and based on iqa scoring, went with the 510k checkpoint as release candidate:

nr_scoring

image

Test

PS just as a test, I tried this model out on the game itself.

I extracted all the Greek Texture files as tga files, upscaled there with chaiNNer with using the onnx conversion, which took 7 hours and 17 min to complete: image

And the converted them back to .ddt files and replaced the in-game texture files using a mod folder (so like a mod basically, replaces the game files): image

And then tested it out in the in-game Editor placing some buildings and units and a fixed camera: image

But as can be seen, there were artifacts when replacing all the texture files, so I tried out only replacing the baseColor files (instead of Normals, Masks etc): image

Which resolved the artifacts, but in comparison with the default textures, it doesnt look better: image

So just to make sure something actually happened, I tested out just inverting the colors on the town center basecolor texture: image

Which shows me that replacing the textures worked.

It simply doesnt show improvements in this case because its a faithful 2x upscale, so if its downscaled to same size again, or in other words, in this view, we still see the TC roofs at the same scale (not bigger), it looks the same.