Skip to main content

TexTile: A Differentiable Metric for Texture Tileability

Project description

TexTile: A Differentiable Metric for Texture Tileability

Official repository of "TexTile: A Differentiable Metric for Texture Tileability" [CVPR 2024]

Carlos Rodriguez-Pardo, Dan Casas, Elena Garces, Jorge Lopez-Moreno

In CVPR, 2024.

Textile-Teaser

We introduce TexTile, a novel differentiable metric to quantify the degree upon which a texture image can be concatenated with itself without introducing repeating artifacts (i.e., the tileability). Existing methods for tileable texture synthesis focus on general texture quality, but lack explicit analysis of the intrinsic repeatability properties of a texture. In contrast, our TexTile metric effectively evaluates the tileable properties of a texture, opening the door to more informed synthesis and analysis of tileable textures. Under the hood, TexTile is formulated as a binary classifier carefully built from a large dataset of textures of different styles, semantics, regularities, and human annotations. Key to our method is a set of architectural modifications to baseline pre-train image classifiers to overcome their shortcomings at measuring tileability, along with a custom data augmentation and training regime aimed at increasing robustness and accuracy. We demonstrate that TexTile can be plugged into different state-of-the-art texture synthesis methods, including diffusion-based strategies, and generate tileable textures while keeping or even improving the overall texture quality. Furthermore, we show that TexTile can objectively evaluate any tileable texture synthesis method, whereas the current mix of existing metrics produces uncorrelated scores which heavily hinders progress in the field.

Quick start

Run pip install textile-metric. The following Python code is all you need. Note that models are downloaded automatically.

import textile
from textile.utils.image_utils import read_and_process_image
loss_textile = textile.Textile() 
image = read_and_process_image(YOUR_PATH)
textile_value = loss_textile(image)

Image preprocessing

Please note that we provide the necessary functionality for image pre-processing on textile/utils/image_utils.py

Installation

pip install -r requirements.txt
  • Clone this repo:
git clone https://github.com/crp94/textile
cd textile

Citation

If you find this repository useful for your research, please use the following.

@inproceedings{Rodriguez-Pardo_2024_CVPR,
    author = {Rodriguez-Pardo, Carlos and Casas, Dan and Garces, Elena and Lopez-Moreno, Jorge},
    title = {TexTile: A Differentiable Metric for Texture Tileability},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, 
    year = {2024}
}

Acknowledgements

This repository is loosely inspired by the LPIPS repository.

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

textile_metric-0.0.10.tar.gz (5.4 MB view details)

Uploaded Source

Built Distribution

textile_metric-0.0.10-py3-none-any.whl (5.4 MB view details)

Uploaded Python 3

File details

Details for the file textile_metric-0.0.10.tar.gz.

File metadata

  • Download URL: textile_metric-0.0.10.tar.gz
  • Upload date:
  • Size: 5.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for textile_metric-0.0.10.tar.gz
Algorithm Hash digest
SHA256 9dfcbeed72db79667b26e8dea067835a58c406fe037cdb0dddd9931deed022ba
MD5 846ab313b2767679a570700297d9370e
BLAKE2b-256 75c4b19765274624628452f8b6b3b2246f81c351ba24a035926ebb4601493ad8

See more details on using hashes here.

File details

Details for the file textile_metric-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for textile_metric-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 60f574cadd2ae29d57c78ee2c2a62c88d03026cdfb25e5a862b3a525e533ca2e
MD5 afd4f19540eaac97b2148b449a5590f4
BLAKE2b-256 b9e1e8fbab3500f1ff897d27aaef6799e40d50b0d26096120b33753606880721

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