Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue end-to-end support for Images and Tensors #3237

Merged
merged 74 commits into from
Sep 7, 2023

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Sep 6, 2023

What

Introduces DepthImage and SegmentationImage as additional archetypes, along with round-trip-tests and code-examples.
Deletes all of the old Image/Tensor related components.
Updates all the necessary places to derive meaning from the indicator components.

This still leaves Images ViewPartSystem as a monolithic system, but splits up the process calls into the 3 separate ArchetypeViews. There's a lot of duplicate code here that could definitely be factored out.

Still Needed for feature-parity with the old APIs.

  • F16 Support

I've added it as TODO:s on #2792

Things to investigate:

  • Roud-trip test is panicking during comparison of annotation_context_segmentation although both code-examples run fine on their own.

Checklist

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

Size changes

Name main 3237/merge Change
human_pose_tracking.rrd 55.58 MiB 460.19 MiB +727.98%

@jleibs jleibs changed the title First pass: use new Tensor types for Image Queries Continue end-to-end support for Images and Tensors Sep 6, 2023
@jleibs jleibs marked this pull request as ready for review September 6, 2023 23:06
@jleibs jleibs added 🐍 Python API Python logging API 🦀 Rust API Rust logging API codegen/idl labels Sep 6, 2023
@@ -46,7 +46,9 @@ pub fn data_cell_from_file_path(file_path: &std::path::Path) -> Result<DataCell,
#[cfg(feature = "image")]
_ => {
// Assume an image (there are so many image extensions):
let tensor = crate::Tensor::from_image_file(file_path)?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this needs to add the indicator components.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't really add an indicator component here until that is its own code-genned struct, which I believe @teh-cmc is working on

) {
TensorDataMeaning::ClassId
} else {
TensorDataMeaning::Unknown
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check for the ColorImage::indicator_component here, and return TensorDataMeaning::Color instead, and use Unknown for when it is truly unknown

@emilk emilk force-pushed the jleibs/tensor_image_queries branch from ff53d77 to 4711404 Compare September 7, 2023 14:18
@emilk
Copy link
Member

emilk commented Sep 7, 2023

Ouch, the example rrd files balloon because jpeg_quality isn't implemented… I guess I need to implement it before merging this PR 😭

@emilk
Copy link
Member

emilk commented Sep 7, 2023

Ok, jpeg_quality is working (though we can discuss the API at some later date)

@emilk
Copy link
Member

emilk commented Sep 7, 2023

When green, I'm hitting merge

@emilk
Copy link
Member

emilk commented Sep 7, 2023

Before implementing jpeg_quality:

image

After:
image

So turns out examples/python/human_pose_tracking/main.py is using dtype=float32 for its segmentation image, and log_segmentation_image doesn't cast to an integer, which I guess it used to do

@emilk
Copy link
Member

emilk commented Sep 7, 2023

Size-bot is lying - human_pose_tracking is back to 56MB now!

@emilk emilk merged commit 146f704 into main Sep 7, 2023
@emilk emilk deleted the jleibs/tensor_image_queries branch September 7, 2023 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen/idl 🐍 Python API Python logging API 🦀 Rust API Rust logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants