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.
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 from the Hugging Face Hub.
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
- Install PyTorch 1.0+ and torchvision fom http://pytorch.org
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.
Metadata
Release files for textile-metric 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| textile_metric-0.0.11.tar.gz | 5.4 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| textile_metric-0.0.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 MB
Release files / textile_metric-0.0.11.tar.gz
| Download URL | textile_metric-0.0.11.tar.gz |
|---|---|
| Size | 5.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43b8e1066f06e1d554e5c870ee330a77c1eb19e877e4bd38157740978266b9b3
|
|
BLAKE2b-256 checksum How to use checksums |
7463542e6c80671fa28417cc5fbc93e23dc7a0b1578150bb887d27afd5e19d29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Release files / textile_metric-0.0.11-py3-none-any.whl
| Download URL | textile_metric-0.0.11-py3-none-any.whl |
|---|---|
| Size | 5.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53e8a84856d2392df7ab769c0e33ecf7e1e6795c347ca58341ae6cf492b7b18c
|
|
BLAKE2b-256 checksum How to use checksums |
650be2b7b1268ddc20ea6a9c7e7e8909dc5f9812ee21fb4abbf621038c7681ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Security for textile-metric 0.0.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.