-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Portilla-Simoncelli model #225
Merged
Merged
Changes from 112 commits
Commits
Show all changes
119 commits
Select commit
Hold shift + click to select a range
cd7ac47
run black on portilla_simoncelli.py
billbrod a88e266
updates docstring
billbrod 9ab9ef7
cleans up _get_rep_scales
billbrod e037240
ran black on steerpyr
billbrod 6bbfdc4
adds type annotations to steerpyr
billbrod 3b50b39
fix typo
billbrod 1a576e9
adds type annotation for PS init
billbrod 6e085ed
Merge branch 'psMinStats' of github.com:LabForComputationalVision/ple…
billbrod 0731e9d
more type annotations
billbrod f58e529
fixes see also
billbrod 7727b0b
updates type annotations
billbrod e936099
fix typo
billbrod b65e87e
updates docstrings in stats.py
billbrod 1f3dbee
PS can use stats.skew/kurtosis rather than having own version
billbrod 5e02309
adds support for multi-batch, multi-channel
billbrod eecb9a3
steerpyr.recon_pyr should return same dtype as it got
billbrod d9f3290
adds modulate_phase function
billbrod 8645c0a
adds build/ dir to gitignore
billbrod f6c24a7
big refactor of PS model
billbrod 911d438
functions in signal.py
billbrod ecdbb91
shrink uses torch.where now
billbrod 67929fa
fix shrink for gpus
billbrod 1df0617
Merge branch 'main' of github.com:LabForComputationalVision/plenoptic…
billbrod 5632008
Merge branch 'ps_refactor' of github.com:LabForComputationalVision/pl…
billbrod 276ac25
corrects type annotation for autocorrelation
billbrod 11ddd7b
use non-downsampled pyramid
billbrod 19cf521
makes new ps version gpu-compliant
billbrod b2813f4
go back to indexing method for shrink
billbrod 9c7f2db
overhaul again! now lists of tensors
billbrod 3d74ed9
fixes for plot_representation
billbrod 8483277
removes attributes that are no longer here
billbrod fb7a924
modulate_phase: only call atan2 once
billbrod ad1b532
remove ues_true_correlation
billbrod b399ffd
remove always unnecessary stats
billbrod d13c2e0
cleans up plotting code
billbrod a3bf090
fix for multi-channel
billbrod 3c50cc2
Adds scales_shape_dict
billbrod 3e69429
Adds necessary stats mask
billbrod 6675871
modulate_phase: only compute x.abs() once
billbrod c943577
updates PS tests to (mostly) work with refactor
billbrod 723fe0b
fixes scale test
billbrod 68ae172
remove torchvision: use center_crop
billbrod d55a5a2
remove negative of phase doubled real
billbrod 6bfbc9a
adds torchvision back as nb dependency
billbrod efd69e7
use tools.center_crop in notebooks
billbrod cb52c38
adds PS tests for differently-shaped images
billbrod efdf4fc
tests, changes for plotting
billbrod cedec11
adds tests for shape and redundancies
billbrod f61d67d
adds tests for expand and shrink
billbrod fe3c1d8
updates tools tests
billbrod 062a30a
bugfix for PS update_plot
billbrod 9e0290b
updates docstrings and comments
billbrod 6359d6c
Merge branch 'main' of github.com:LabForComputationalVision/plenoptic…
billbrod 916bea5
updates metamer and display notebooks for new PS
billbrod 9745dff
corrects indent
billbrod 4a97218
reruns PS notebook through final section
billbrod c1817f0
Merge branch 'ps_refactor' of github.com:LabForComputationalVision/pl…
billbrod b602367
starts changing to true cross-corr
billbrod a3adb92
adds new section to tips
billbrod f5cc7fe
adds mags_std to representation
billbrod 315e0f4
updates tests for real cross-corrs
billbrod f24caae
adds test for cross correlations
billbrod 42a33c9
reruns most of PS notebook
billbrod 71c23f2
Literal comes from typing_extensions in python 3.7
billbrod fe9eac9
Merge branch 'ps_refactor' of github.com:LabForComputationalVision/pl…
billbrod 38c392e
Literal comes from typing_extensions in python 3.7
billbrod 4afc98b
fixes some failing tests
billbrod 18f1996
adds url for ps_synth_gpu refactor
billbrod 25d3510
fixes to make tests run on GPU
billbrod e2e663d
Merge branch 'ps_refactor' of github.com:LabForComputationalVision/pl…
billbrod 3b1b391
Merge branch 'ps_refactor' of github.com:LabForComputationalVision/pl…
billbrod a7a8061
fix: center_crop accepts only single int
billbrod fdc99ae
testing.array_equal for arrays, not testing.equal
billbrod eb1bd17
make shrink and expand error messages the same
billbrod e13b3b3
updates some tolerances
billbrod f60198a
fix failing test
billbrod 3f78113
fixes failing tests
billbrod aef0696
fixes failing tests
billbrod d2ca2a8
fix for gpu tests
billbrod a9bdc65
Merge branch 'main' of github.com:LabForComputationalVision/plenoptic…
billbrod e709187
Merge branch 'main' of github.com:LabForComputationalVision/plenoptic…
billbrod fb479d3
Merge branch 'main' of github.com:LabForComputationalVision/plenoptic…
billbrod a2ab279
Make PS statistics tutorial work for refactored code
dherrera1911 b8cb360
Fix variable name typo
dherrera1911 f9f230a
Apply Edoardo's suggestions from code review
billbrod be7909d
add update_plot test
billbrod 02a72ea
adds test for convert to dict errors
billbrod 9327bcd
test even spatial_corr_width
billbrod 493eb40
updates test_ps_torch_output
billbrod 2dde6a9
adds test_vectors_refactor.tar.gz to osf_download
billbrod ce13d8b
updates test_ps_scales to include even spatial corr width
billbrod aebfcca
Merge branch 'ps_refactor' of github.com:LabForComputationalVision/pl…
billbrod 919a0eb
runs isort
billbrod 95ca562
makes pyramid attribute private
billbrod 514acf3
replace B,C,S / B,C,H,W style notation
billbrod 856df9d
adds Raises to PS.forward()
billbrod be22a16
breaks up line
billbrod f7a575d
change type annotations for Figure/Axes
billbrod c4ee4bd
adds explanation for einops.rearrange
billbrod 15fbf5b
tries to straighten out type annotations
billbrod 15dddf7
fix for last commit
billbrod 78144d2
change threshold to be based on dtype.resolution
billbrod b23b5c0
switch from single letter var
billbrod 28b3874
adds module level docstrings
billbrod ea17809
fix failing test on gpu
billbrod 28ff190
fix failing notebook
billbrod bbbd2ac
Merge branch 'ps_refactor' of github.com:LabForComputationalVision/pl…
billbrod 9f323f3
rename vector -> tensor, update notebook
billbrod 9b09d27
Updates PS notebook with magnitude means
billbrod 76e59fa
rearrange cells
billbrod 29d46fd
adds more detailed explanation of scales shape dict
billbrod 191bbe3
updates language in notebook
billbrod 1bf81ef
updates description of expand/shrink
billbrod de5c970
removes unnecessary comments
billbrod 9817859
updates PS notebook
billbrod f692242
Merge branch 'main' of github.com:LabForComputationalVision/plenoptic…
billbrod ea86a6a
fixes some rendering issues
billbrod 99cdcae
fix typo
billbrod cad4606
fixes failing things from merge
billbrod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big picture-impression. This is very cool. The paper is very interesting, and it will be great to have a notebook illustrating these ideas and Python implementation! The stuff on blended textures is really cool! Generally the flow is good, and it is very clear. My comments below are in the spirit of trying to find something to give constructive criticism about. But honestly, you could hit commit and it would be fine.
At a finer level, and this is for someone coming as an outsider, I am a littler less sure of how "metamer" is defined when it comes to texture, because many of the examples of what I thought were supposed to be metamers I can clearly distinguish them from the original. Please forgive me for being dense here and maybe I'm just missing some explanations -- I skimmed this relatively quickly to get the gist!
I would consider perhaps addressing this or put more compelling cases in there earlier on (e.g., in the paper some of the cases seem much more compelling like Figure 12, 13, 15). You clearly are being quantitative throughout, talking about errors for different models rather than absolute matching. So maybe it isn't about exact matching, but degree or closeness for these models. Maybe if you emphasized this a bit more -- though ultimately with metamers we evaluate perceptually right? I am out of my field here. 🤣
I'm not sure if there is a good alternative to the name
man-made
I couldn't think of one that was really natural and left out gendered jargon. But that does read a bit dated now to my ears. Though I'm sure some people would fight back against me on this -- feel free to ignore. 😄There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll try to clarify what's going on. In brief: we're overloading the word "metamer". Generally, people use it to mean "perceptual metamer", i.e., two images that are physically distinct but that humans perceive as identical. Typically in plenoptic, we use it to mean "model metamer", i.e., two images with different pixel values but (near-)identical model outputs. What that means with respect to perception depends on your model: if your model predicts single-cell responses, there might be no relationship with perception! for the texture model, humans should perceive model metamers as belonging to the same texture class. I'll make this more explicit in the notebook
Re: "man-made". How about "artificial"? (I don't want to use synthetic, because we mean something specific with that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification: I realize that is a thing in plenoptic, but I had assumed (without reading) the paper that they were giving a model of human vision, so were trying to give perceptual metamers, which is one reason I was concerned (speaking from the perspective of psychophysics). But if it is all about metamers wrt some model (that may or may not be a good model of human vision), then I'm fine with that (e.g., I assume that for texture they can be differentiable on some irrelevant dimension like a phase shift or whatever). But this last point on textures is important: I was probably not thinking enough about textures (vs pure perceptual similarity) when evaluating the metamers ; just went back and looked -- no I was pretty accurate in my assessment 😄 many of the later ones do seem much better at capturing even textural features better.
But one thing I did not pay attention to was discussion of different classes of models, whether some were intentionally meant to be worse than others, etc.
With the jargon, I got stuck as I realize it can't be 'synthetic' , but also 'artificial' is already taken in the nb by the clearly fake line drawings. I considered just 'human-made' but that can come off as heavy handed to some people. 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, excellent. This "what do we mean by metamers" question will be a sticking point for people -- it's an important distinction to get! I should probably just discuss it in more places; no harm in restating it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for jargon: I'm going to try replacing "man-made" with "artificial" and replace what we had called "artificial" with "hand-drawn / computer-generated", which is more precise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good.