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

[BUG] Media lost after view.save() #4232

Open
mmoollllee opened this issue Apr 5, 2024 · 3 comments
Open

[BUG] Media lost after view.save() #4232

mmoollllee opened this issue Apr 5, 2024 · 3 comments
Labels
bug Bug fixes

Comments

@mmoollllee
Copy link

Describe the problem

Media does not show anymore in the App after I remaped labels in a python session. After hitting view.save() media was gone!?
Is there any cache I should clear?

Code to reproduce issue

This happend for two independend datasets:

  1. I opened a python interpreter in the terminal
  2. launched a fiftyone sessione
import fiftyone as fo
from fiftyone import ViewField as F
session = fo.launch_app()
  1. created a view
view = dataset.match(F("ground_truth.detections").length())
view = session.dataset.map_labels("ground_truth", {"AAAAA": "BBBBB"})
view.save()

Looks like every sample within the view is okay?

grafik grafik

System information

  • macOS 14.4 (23E214)
  • Python 3.9.18
  • FiftyOne v0.23.6, Voxel51, Inc.
  • FiftyOne installed from (pip or source): pip
@mmoollllee mmoollllee added the bug Bug fixes label Apr 5, 2024
@brimoor
Copy link
Contributor

brimoor commented Apr 5, 2024

I tried to reproduce but this works fine:

import fiftyone as fo
import fiftyone.zoo as foz
from fiftyone import ViewField as F

dataset = foz.load_zoo_dataset("quickstart")

session = fo.launch_app(dataset)

print(len(dataset))  # 200
print(dataset.count("ground_truth.detections"))  # 1232

view = dataset.match(F("ground_truth.detections").length())

print(len(view))  # 199

view2 = view.map_labels("ground_truth", {"carrot": "CARROT"})
view2.save()

## ensure data is all still there

print(len(view))  # 199
print(len(dataset))  # 200
print(dataset.count("ground_truth.detections"))  # 1232
print(dataset.count_values("ground_truth.detections.label")["CARROT"])  # 47

## refresh app, everything looks fine

@mmoollllee
Copy link
Author

mmoollllee commented Apr 5, 2024

Yeah same for me with the quickstart dataset...

More info on what I notice on media NOT showing:

  • in the overview the select checkbox does not show up on hover
  • in metadata section bytes, file_type and num_channels is showing up

On media showing:

  • in metadata section bytes, file_type and num_channels is not showing up

Looks like metadata was ommitted when I saved the view?
So I tried:

dataset.compute_metadata(overwrite=True, skip_failures=False, warn_failures=True, progress=True)

Now every sample has metadata, but no change.

I came up with the glory idea to open the app in the browser. In the console I got TypeError: e.detections is null for media without ground_truth.

view = session.dataset.match(F("ground_truth.detections").length() == 0)
for sample in view:
   sample["ground_truth"] # Returns <Detections: {'detections': []}>

What should I set them to?
Maybe still a bug that this happend?

@benjaminpkane
Copy link
Contributor

Fixed by #4345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes
Projects
None yet
Development

No branches or pull requests

4 participants
@benjaminpkane @brimoor @mmoollllee and others