Comments (23)
Hi @segalinc
Could you share a code snippet of how you're running it and preferably a sample of strings that you're using as your local paths? Also what notebooks environment you're running it in? (e.g.: Jupyter, Google Colab, etc.)
from ipyplot.
I am using jupyter notebook
here is the line I am calling
ipyplot.plot_class_tabs(df.path, df.feature_code, custom_texts = df.feature_value.astype(float).round(4), show_url=False, tabs_order=cols)
where df.path is a dataframe columns with strings like data/image_name.jpg
and data is in the same folder as the notebook I am running
I used the same command line where df.path was an url instead and it worked fine
I also tired to have a column with the loaded pil images too but it doesn't work
force_b64=True
takes forever to run and than crashes
from ipyplot.
Since you mentioned it works fine when you try running ipyplot directly with string URLs I would bet that there's something funky happening when you pass your column (pandas series object) as an input. Maybe the data type is something else than string? Please try running the following lines an let me know what is the output:
print(df.path.dtype)
print(type(df.path.values[0]))
print(type(df.path[0]))
I'm trying to recreate your scenario but I'm failing to get any errors. I have the same setup as you with data folder with images located in the same dir as my notebook and I run something like this with success:
Please provide the following info for me to try recreate your issue:
- Which version of ipyplot, python and pandas are you using?
from ipyplot.
Hi thank you again for helping. this are the info you requested
ipyplot==1.1.1
python==3.7.12
pandas==1.3.5
print(df.path.dtype) --> object
print(type(df.path.values[0])) --> <class 'str'>
print(type(df.path[0])) --> <class 'str'>
from ipyplot.
Thanks for providing additional info.
I'm trying to recreate this issue but it doesn't show up in any of my test environments...
I assume simply running ipyplot.plot_images(df.path)
doesn't work either?
from ipyplot.
No it doesn't
from ipyplot.
Are there any special characters in the image paths? Such as space
, &
, $
, %
?
Could you please share few actual strings from df.path
?
from ipyplot.
No, here are some examples
0 img/60027106_1672795_141993.jpg
1 img/60027106_1672795_100199.jpg
2 img/60027106_1672795_15606.jpg
from ipyplot.
Just to be absolutely sure - if you run bellow code it displays images correctly?
images = ["img/60027106_1672795_141993.jpg", "img/60027106_1672795_100199.jpg", "img/60027106_1672795_15606.jpg"]
ipyplot.plot_images(images)
from ipyplot.
no, that doesn't work either
from ipyplot.
And img
directory is located in the same directory as the .ipynb
notebook file you're running your code from?
At which directory level is your jupyter server running?
from ipyplot.
yes it is.
it runs internally in our infrastructure. I also tried using absolute paths but same issue.
tried also reading the images in PIL and expose them directly but seems like it has issue loading them too
from ipyplot.
That's very odd.. There's a known issue with not displaying images from directories outside of Jupyter server scope but I'm not convinced if that's the case here. You can check this thread to find out if it's relevant at all for your case.
And as for PIL, does this work for you?
from PIL import Image
images = ["img/60027106_1672795_141993.jpg", "img/60027106_1672795_100199.jpg", "img/60027106_1672795_15606.jpg"]
ipyplot.plot_images([Image.open(path) for path in images])
from ipyplot.
that's exactly what I tried and it doesn't work.
I also already checked that issue before opening this one
Using force_b64 takes forever to run and than it doesn't even show anything afterall, very odd
from ipyplot.
What's the error message when you try to open images with PIL?
from ipyplot.
the is no error message at all,
when I run the cell, it seems running then the kernel look like had completed the execution but the cell still shows the * as it is still working on it and no output, same with the path and force_b64
from ipyplot.
That's super weird. As much as I'd like to help you, I'm afraid I'm out of ideas at this point..
from ipyplot.
I appreciated you bared with me so far. I might ask some of my peers if they have any issue as well using the tool
should we leave this open ?
from ipyplot.
Yes, let's leave this issue open for now, thanks.
If you will get to the bottom of this at any point, please loop back and drop a msg here for others.
Good luck!
from ipyplot.
it seems that even passing the numpy version of the images doesn't work as I saw you can also pass arrays
I can open and show the images in the notebook with Image.open(local_path) though so this is a bit weird
from ipyplot.
Wait, Image.open()
works for you but when you do this: ipyplot.plot_images([Image.open(local_path)])
it doesn't work? Is that correct?
That is extremely weird and I have zero explanation for such behavior
from ipyplot.
ipyplot.plot_images([Image.open(local_path)])
this works
this works too ipyplot.plot_images([Image.open(i) for i in df.path.iloc[:10]])
all the others, list of path, df column with paths, df columns with loaded images don't work, I also see that bc of the use of Image the RAM goes up quite a bit like is loading all the images in
from ipyplot.
i have the same issue, when i try to load a list of strings, i get empty image symbols.
when i load the images and insert a list of images to the function - it works fine.
the problem is that i have many images and i wanted to leverage on the random selection of images from max_imgs_per_tab, loading all the images results in ram overload
from ipyplot.
Related Issues (20)
- GREAT WORK! Thank you!!
- [Bug] Can't select text from a text field HOT 1
- [Bug] Image resolution vs image width - blurry images when zoomed in HOT 1
- [Bug] Warning about google colab runtime could be a tad more helpful/precise (base_64) HOT 1
- [Bug] Different type checking for same-size vs different size images in group HOT 1
- [Docs] add back examples that can be copy/pasted in readme HOT 1
- Number of Images Displayed HOT 1
- Disable enlarge image HOT 1
- Sort images in plot_class_tabs HOT 2
- Change background color HOT 1
- numpy 1.20+ does't have `np.float` HOT 2
- Is there any way to hide `show html` button? HOT 1
- It would be nice if the return_html option is present HOT 1
- Warning about using JpegImageFile under Python 3.11 HOT 1
- would be better if images are resized
- pypi version not working with latest numpy. master partly fixes but fails with PIL images. HOT 2
- Patch security vulnerability with a new release
- AttributeError: module 'numpy' has no attribute 'float'. HOT 4
- labels color issues HOT 1
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 ipyplot.