Skip to main content

SRCNN implementation for upsampling grayscale images of tire treads.

Project description

TreadSRCNN

PyPI version Downloads

This package provides SRCNN model implemented in PyTorch. This model is only intended for use on grayscale images, and was created as an extension to treadscan.

Treadscan is a Python package containing computer vision tools for extracting tire treads. Sometimes, the scanned treads are in lower quality, because a vehicle hasn't stopped in the correct position, or the camera was out of focus. Applying upsampling to these images might help mitigate these issues.

Example of occurence of lower resolution tire treads (vehicles stopped far away, in the other lane): Treadscan tire segmentation

Quick summary of this project is contained in this paper in the root of the repository. It was made as semestral work for Computational Intelligence Methods course at FIT CTU.

Example usage

import cv2
from treadSRCNN import SRCNN

low_resolution_image = cv2.imread('low_resolution_image.png', cv2.IMREAD_GRAYSCALE)

# Pretrained models can be found in https://github.com/bohundan/treadscan-SRCNN/tree/main/pretrained_models
srcnn = SRCNN('pretrained_weights.pth')

# Factor determines the upscaling factor
# The higher the batch_size, the more memory is consumed during upsampling 
# (my 6GiB VRAM GPU can do around 500 batch_size comfortably)
upsampled_image = srcnn.upsample(low_resolution_image, factor=4, batch_size=100)

Upsampling preview

There is some tradeoff between sharper image and added noise.

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

treadSRCNN-0.1.4.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

treadSRCNN-0.1.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file treadSRCNN-0.1.4.tar.gz.

File metadata

  • Download URL: treadSRCNN-0.1.4.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for treadSRCNN-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0d4715f050d6b4655ab13a2751b15244f6f0a6150577bc94b61554b7a27b65dd
MD5 7040475272e3b9484839ff643784f125
BLAKE2b-256 3a2d9b3ded29aa64b56658a9a6b6def643cd4b8ed462e042c914d22ba310619c

See more details on using hashes here.

File details

Details for the file treadSRCNN-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: treadSRCNN-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for treadSRCNN-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d23c00bad313321814c0b497039bbc0ac00a99ce037bc2a3aa70d8194dabcc0c
MD5 2afafa3e9c68e5e486e9ede2749f19e3
BLAKE2b-256 b95d5cecfe5b6d9e5f0a002f8072c77f924e4d22f893feb4faea1fdce35e090e

See more details on using hashes here.

Supported by

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