question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Differentiable torch.histc and differentiable equalize

See original GitHub issue

🚀 Feature

Our current implementation used a non-differentiable implementation of equalization. Mainly, it is caused by the non-differentiable torch.histc. We may have different differentiable estimators to estimate the image histogram.

Presumably, I would expect an API as:

def equalize(image, estimator=None):
    if estimator is None:
        hist = torch.histc(...)
    elif estimator == 'gaussian':
        hist = kornia.gaussian_hist(...)
    ...

Additional context

There are some materials already to estimate the image histogram as here.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
shijianjiancommented, Jul 26, 2021

I’ve implemented differentiable image histogram using triangular kernel density estimation using bandwidth = (max - min) / n_bins. This histogram is approximate. How would you suggest to do test_uniform_dist or other tests for approximation?

Is it an implementation from a standard library? We may test the results against other libraries if appropriate.

Or, you may simply test using a manual seed. Using Monte Carlo is even better but I have no idea how to do that. XD.

0reactions
shijianjiancommented, Oct 14, 2021

@connorlee77 making sense. Can you file a ticket?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Differentiable torch.histc? - autograd - PyTorch Forums
Hi everyone, I found out that the derivative for 'histc' is not implemented. Is there a way to easily implement a histogram function...
Read more >
kornia.enhance.equalization - Read the Docs
"""In this module several equalization methods are exposed: he, ahe, clahe.""" from typing import Tuple import math import torch import torch.nn.functional ...
Read more >
Schedule - FiO+LS
Introduction to Odak: a Differentiable Toolkit for Optical Sciences, Vision Sciences and ... HoloTorch - Differentiable Coherent Light Transport in PyTorch.
Read more >
Jumpstarting Link-Level Simulations with NVIDIA Sionna
Many 6G technologies require the simulation of a specific ... Apart from a few exceptions, all components are differentiable so that ...
Read more >
1 Introduction - COMP3204 Computer Vision
Feature Extraction and Image Processing in Computer Vision ... differentiate between objects in our field of view). ... Code 3.3 Histogram Equalisation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found