question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE] Add support for other dtypes to Image in schema

See original GitHub issue

🚨🚨 Feature Request

  • A new implementation (Improvement, Extension)

Is your feature request related to a problem?

Currently, users are only able to use Image in schema with dtypes “uint8” and “uint16”. Using other integer and float types raises an error.

If your feature will improve HUB

More freedom for users to use different dtypes in Image.

Description of the possible solution

Modify hub.schema.Image to permit other integer and float dtypes. Also, add a check that ensures that in case the compressor is “png” and dtype other than “uint8” and “uint16” is specified, raise an error. Similarly, if the compressor is “jpeg” and a dtype other than “uint8” is specified, raise an error. The errors should be raised during the constructor call i.e. when _init_ is called.

Teachability, Documentation, Adoption, Migration Strategy After the fix, this code should work:-

schema_1 = {
    "image" : hub.schema.Image((500, 500, 3), "float64")
}

while this should raise an error

schema_2 = {
    "image" : hub.schema.Image((500, 500, 3), "float32", compressor="png")
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
madhucharancommented, Feb 3, 2021

Hi, I would like to know about all the expected dtypes to be included and any other checks needed for any other format other than the two checks mentioned (for png and jpeg)

0reactions
mynameisvinncommented, Mar 23, 2021

Closing due to inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pandas.DataFrame.convert_dtypes
Convert columns to best possible dtypes using dtypes supporting pd.NA . New in version 1.0.0. ... In the future, as new dtypes are...
Read more >
datasets/arrow_dataset.py at main · huggingface ... - GitHub
The largest hub of ready-to-use datasets for ML models with fast, easy-to-use and efficient data manipulation tools - datasets/arrow_dataset.py at main ...
Read more >
Overview of Pandas Data Types - Practical Business Python -
This article will discuss the basic pandas data types (aka dtypes ), how they map to python and numpy data types and the...
Read more >
How Python type hints simplify Pandas UDFs in Apache Spark ...
In the future, we should consider adding support for other type hint combinations in both Pandas UDFs and Pandas Function APIs. Currently, the ......
Read more >
Process - Hugging Face
Reorder rows and split the dataset. Rename and remove columns, and other common column operations. Apply processing functions to each example in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found