Skip to main content

Analyze Native Resolution with Vapoursynth and more

Project description

Getnative

Analyze the native resolution(s) of upscaled material (mostly anime)

Usage

Start by executing:

$ getnative [--args] inputFile

If getnative could not be found, try executing this:

# Linux
$ python -m getnative [--args] inputFile

# Windows
$ py -3 -m getnative [--args] inputFile

or

Start by executing:

$ python -m getnative [--args] inputFile

That's it.

Requirements

To run this script you will need:

Installation

After installing the above prerequisites, install the project via:

$ pip install getnative

or

  • Download all files from github
  • Install all Python dependencies through pip install -r requirements.txt

Recommended Windows Installation

Install these programs from their websites:

Once Vapoursynth is installed:

vsrepo.py install descale
vsrepo.py install ffms2
vsrepo.py install lsmas

Install getnative (and Python dependencies):

pip install getnative

Example Output

Input Command:

$ getnative -k bicubic -b 0.33 -c 0.33 -dir "../../Downloads" "../../Downloads/unknown.png"

Terminal Output:

Using imwri as source filter

500/500

Output Path: /Users/infi/Downloads/results

Bicubic b 0.33 c 0.33 AR: 1.78 Steps: 1
Native resolution(s) (best guess): 873p

done in 13.56s

Output Graph:

alt text

Output TXT (summary):

 868		 | 0.0000863251		 | 0.93
 869		 | 0.0000828592		 | 1.04
 870		 | 0.0000734709		 | 1.13
 871		 | 0.0000555885		 | 1.32
 872		 | 0.0000596791		 | 0.93
 873		 | 0.0000011579		 | 51.54
 874		 | 0.0000385670		 | 0.03
 875		 | 0.0000433674		 | 0.89
 876		 | 0.0000548476		 | 0.79
 877		 | 0.0000614557		 | 0.89
 878		 | 0.0000740702		 | 0.83

Args

Property Description Default value Type
start Specify a starting frame for the analysis. 0 Int
end Specify the last frame for the analysis. Last Frame of Video Int
samples Specify number of frame samples for the analysis. 5 Int
kernel Resize kernel to be used bicubic String
bicubic-b B parameter of bicubic resize 1/3 Float
bicubic-c C parameter of bicubic resize 1/3 Float
lanczos-taps Taps parameter of lanczos resize 3 Int
aspect-ratio Force aspect ratio. Only useful for anamorphic input w/h Float
min-height Minimum height to consider 500 Int
max-height Maximum height to consider 1000 Int
is-image Force image input False Action
generate-images Save detail mask as png False Action
plot-scaling Scaling of the y axis. Can be "linear" or "log" log String
plot-format Format of the output image. Specify multiple formats separated by commas. Can be svg, png, tif(f), and more svg String
show-plot-gui Show an interactive plot gui window. False Action
no-save Do not save files to disk. False Action
stepping This changes the way getnative will handle resolutions. Example steps=3 [500p, 503p, 506p ...] 1 Int
output-dir Sets the path of the output dir where you want all results to be saved. (/results will always be added as last folder) (CWD)/results String

CLI Args

Property Description Default value Type
help Automatically render the usage information when running -h or --help False Action
Absolute or relative path to the input file Required String
mode Choose a predefined mode ["bilinear", "bicubic", "bl-bc", "all"] None String
use Use specified source filter (e.g. "lsmas.LWLibavSource") None String

Warning

This script's success rate is far from perfect. If possible, do multiple tests on different frames from the same source. Bright scenes generally yield the most accurate results. Graphs tend to have multiple notches, so the script's assumed resolution may be incorrect. Also, due to the current implementation of the autoguess, it is not possible for the script to automatically recognize 1080p productions. Use your eyes or anibin if necessary.

Thanks

BluBb_mADe, kageru, FichteFoll, stux!, LittlePox, infi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

getnaive-0.0.2.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

getnaive-0.0.2-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file getnaive-0.0.2.tar.gz.

File metadata

  • Download URL: getnaive-0.0.2.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for getnaive-0.0.2.tar.gz
Algorithm Hash digest
SHA256 774a0beb0f3292ffbd023f62718b8cea2dc0a6b0151614025a2198ccd89d17de
MD5 e68c635eb74bdfa407cebf2dbf4e40c3
BLAKE2b-256 8cd9fd1fdf37b2380d860538662c06a2a380d283cad2c6394c2ee64b37a5dc70

See more details on using hashes here.

File details

Details for the file getnaive-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: getnaive-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for getnaive-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 25b62a442a71dd663c365995dde2b0735d7856420a35b15f86874d466fb8e91c
MD5 a26d4c0c09ab45c3d3d194ae6f5fc2f4
BLAKE2b-256 8c069015f4df633db569e2f12e3ef5c950db0a01a7ac9930886c1d5c5f9879c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page