Comments (3)
Hi Eric!
I can't seem to be able to reproduce it.
In Colab, I tried:
import mediapy as media
images = {f'image{index}': media.color_ramp((512, 512)) for index in range(32)}
media.show_images(images)
and it shows 32 images of size (512, 512, 3).
When I right-click Save_as_image on one of them, it does save as a 512x512 image.
In Jupyter Lab, it shows 32 shrunk images such that all of them appear in the window width.
But again when I shift-right-click Save_as_image it is natively 512x512.
(The scaling there might be adjustable using CSS styles.)
Please give us more details. Perhaps try Chrome Developer Tools (Control-Shift-i) to examine the native image resolution?
Is there any OS display scaling (e.g., Windows "Make everything bigger") or Chrome Zoom scaling?
from mediapy.
Hi Hugues!
All the input image resolutions I reported were obtained printing the np.ndarray.shape
.
All the display resolutions I reported were obtained after right-clicking on the image displayed by mediapy and selecting "Open in a new tab" in Google Chrome. I then hover the mouse over the new tab and a tooltip appears showing the native resolution of the image being displayed among other things. right-click+save the image produces an image file of that resolution.
In my use-case I get an image_batch
from my ML pipeline data-loader, with shape (1, 32, 512, 512, 3) and dtype=np.float32
. I display it with:
def display_image_row(image_row):
image_dict = {}
for col in range(image_row.shape[0]):
image_dict[f'{col}'] = image_row[col]
media.show_images(image_dict, height=512, downsample=False, ylabel='row0')
display_image_row(image_batch[0])
Whether or not I convert the input image_batch
first to uint8, I get the same issue.
image_batch = image_batch * 255
image_batch = image_batch.astype(np.uint8)
from mediapy.
Are you using Colab? Please see my shared Colab notebook in https://colab.research.google.com/drive/1pkTsS0v40kbf66d6a_rfMS1V6VrS247d?usp=sharing
which seems to work fine with both np.uint8
and np.float32
and with/without the height
and downsample
flags.
from mediapy.
Related Issues (16)
- Will support transform BGR to RGB for 3-channel images? HOT 2
- `codec="gif"` gives not RGB color HOT 4
- show_image() shows jaggies when the desktop or browser is magnified
- video show no content HOT 5
- Incorrect video framerate HOT 3
- Unrecognized option 'qp' HOT 2
- AttributeError: module 'PIL.Image' has no attribute 'Resampling' HOT 3
- Unable to parse video framerate in line HOT 1
- Side by side image comparison slider HOT 1
- Intermittent test failure
- mediapy load, visualize or write a video with audio HOT 1
- ffmpeg with copy codecs is not guaranteed to contain number of frames in output HOT 1
- Large videos HOT 5
- question about write_video HOT 2
- Setting vmin to a value greater than 0 can produce unexpected results for unsigned integer types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mediapy.