I have a .tiff image dataset that I want to load in FiftyOne. I’ve gone through the Docs and only found Geotiff dataType so I load it as a fiftyone.types.ImageDirectory.
I got: Type image/tiff may not be supported.
Came on SOF searching for a solution and came across this answer from Eric https://stackoverflow.com/a/73775999/19902725 Suggesting using a browser extension or Safari as it natively supports loading .tiff
1 - The extensions work by intercepting the URL and checking if it ends with a .TIFF so it itself could handle the request. Fiftyone loads the DS using a URL but loads the individual images in it dynamically which won’t trigger the extension to load the image. 'At least in Brave browser'
2 - Switched to Safari after giving up on the extension route but the loaded images are cropped to less than a quarter of the original image (1440 × 1080)
Any other solutions?
An alternative is to use the newly added support for multiple media fields per sample. With this, you could generate a png or jpg for each tiff image and store these alternate filepaths on your samples in a new field, then toggle between tiff and png/jpg media in the App.
sample = fo.Sample(filepath="/path/to/img.tiff")
sample["jpg_filepath"] = "/path/to/img.jpg"
dataset.add_sample(sample)
dataset.app_config.media_fields.append("jpg_filepath")
dataset.save() # must save after edits
Related
I downloaded an image from a url such as "https://www.xxxx.com/filename.jpeg. I expected that that image is a jpeg image whose format is acceptable for Computer Vision Annotation Tool (CVAT). However, it was saved as filename.heif or filename.jpeg.heif, so it causes an error when I tried to create a task with that image because heif format is not acceptable in CVAT. (CVAT automatically downloads images and create a task once I put image urls and submit them.)
I usually put more than 1000 image urls to create a task, and it is really hard to find invalid url or image among them.
Is there any way to find the "actual format" only by looking at the image url? Or can I just skip invalid urls in CVAT?
Thank you.
I am trying to reduce(compress) image file size dynamically.
Reason being I need it dynamically, because I need to use it in full size as well on another pages.(Hence I cant make any changes to original images at server)
The project I'm working on is like blog post. on main page there are few featured_post which contains image and post data. when we clicked on the post, it will in full where the post image will load in in background and on main page it acts like a thumbnail
issue: on main page when images load into the featured_post it should load in reduced size than original to finish the loading of page quick
Note : at least 20 featured_post per page
I suggest you generate all the needed sizes and resolutions when saving a blog post - not on the fly. Obviously for performance reasons.
For image manipulation in Python I recommend you to use the pillow library:
https://pillow.readthedocs.io/en/stable/
is there an option to do some image cropping in cloudinary and save it in local project folder. transformations like detect face and save as profile image. is there any other plugins for the same?
All images (originals and derived) are saved in your Cloudinary cloud storage.
If you want to tell the browser to download a specific image instead of showing it, you can use the attachment flag (fl_attachment in URLs).
For example, resizing the image to a width of 300 (w_300 in URLs) before downloading it -
http://res.cloudinary.com/demo/image/upload/w_300/fl_attachment/sample.jpg
Have you checked out official cloudinary documentation regarding django integration.
Also there is python library on which this is based upon ( pycloudinary)
I am writing a webcrawler that finds and saves the urls of all the images on a website. I can get these without problem. I need to upload these urls, along with a thumbnail version of them, to a server via http request, which will render the image and collect feature information to use in various AI applications.
For some urls this works no problem.
http://images.asos-media.com/products/asos-waxed-parka-raincoat-with-zip-detail/7260214-1-khaki
resizes into
http://images.asos-media.com/products/asos-waxed-parka-raincoat-with-zip-detail/7260214-1-khaki?wid=200
but for actual .jpg images this method doesn't work, like for this one:
https://cdn-images.farfetch-contents.com/11/85/29/57/11852957_8811276_480.jpg
How can I resize the jpgs via url?
Resizing the image via the URL only works if the site you're hitting is using a dynamic media service or tool in their stack. That's why ASOS will allow you to append a query with the dimensions for resize, however different DM tools will have different query parameters.
If you want to make it tolerant you're best off downloading the image, resizing it with Python and then uploading it.
I want to save a .jsp image from a web page in to my computer using python.
I have tried many methods including
retrieve function in mechanize and
urllib.urlretrieve('http://example.com/img.jsp', 'img.jsp')
but the problem is when I try to open the image using the image library it throws the following error
File "code.py", line 71, in extract_image
im = Image.open(image_file)
File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1980, in open
raise IOError("cannot identify image file")
I have even tried saving the image in .png format, but its not working.
But I can do the save manually by going to the image url and then saving the image.
Pls help!
You haven't provided enough information, but my guess is that the web server isn't responding the way you think it is -- did you peek the HTTP traffic with Fiddler or Firebug or look at what's in the file?
Can you get a copy of the image some other way -- if so, compare that to what you downloaded programmatically.
Finally, I am not sure what a JSP image is -- if img.jsp is a JavaServerPage that responds with an image, that doesn't make the image a JSP image -- it's still in the format that corresponds to its Content-type.