Optimize execution speed #62
Labels
No Label
bug
Context-Adaptive Interpolator
duplicate
enhancement
epic
help wanted
high priority
invalid
left for future work
low priority
medium
medium priority
meta
question
quick
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Benjamin_Loison/Robust_image_source_identification_on_modern_smartphones#62
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Initially at #8.
https://github.com/JeffOwOSun/gpu-bm3d
https://github.com/OpenImageDenoise/oidn
Related to #53.
Need
builtins
import otherwise get:Thanks to the Stack Overflow answer 5347492:
So reduced 21 seconds per merge to 1 second.
Related to issues/25#issuecomment-1476.
It does not seem that can only load part of a raw image with rawpy, if even possible at all.
In
getRawColorChannel
:or
do not result in significant execution speed increase.
So only loading the specified color channel might not help too.
However, can keep the crop loaded into memory such that do not have to load the whole image when want to work with it. Assuming loading the whole raw images is the issue, can just load to memory
getSingleColorChannelImages
.Could save the crops as Numpy arrays on hard disk if want to avoid loading time.
An interesting thing would be to save the images in a format such that can load only part of the image.
The question is what data structure do I precisely want to store this way?
getSingleColorChannelImages
callsgetColorChannel
which callsgetRawColorChannel
. So adict
or similar seems to make sense. Maybe partial read is not compatible withdict
and will have to make a file per color channel.Thought about using
benchmark_raw_images_loading.py
:but in fact just using
time
and adding anexit
to current algorithm was faster to use and almost as precise.Source: https://numpy.org/doc/1.26/reference/generated/numpy.load.html
https://numpy.org/doc/1.26/reference/generated/numpy.memmap.html#numpy.memmap
https://numpy.org/doc/1.26/reference/generated/numpy.save.html
Someone asked this question as the Stack Overflow question 42727412.
With all colors:
With only one color:
Should have at least a factor 4 improvement as only consider a single color.
Related to Benjamin_Loison/rawpy/issues/2.
Loading all colors on both cameras:
For saving:
With
.npy
loading:Note that could consider a middle image (per image resolution) crop to reduce possible issues like vignetting.
Can also consider random location crop.
Well I was only saving the last color.
Saving each color channel in a different file:
My tests seem biased due to a cache.
For Rafael 23/04/24 estimated PRNU with mean denoiser:
400x400 (per color channel) centered crop:
6024x4024 so 800x800 centered crop is from (2612, 1612) to (3412, 2412).
Could use same color scale to ease comparing both images.
On the crop we seem to particularly see the lines artifacts, see #70.