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

Add ability to export transformed dataset #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alesgenova
Copy link
Member

Related to #126

@alesgenova alesgenova requested a review from PaulHax December 13, 2024 19:58
@alesgenova alesgenova force-pushed the export-dataset branch 2 times, most recently from 919dcdf to de9864c Compare December 13, 2024 21:55
@PaulHax PaulHax linked an issue Dec 17, 2024 that may be closed by this pull request
Copy link
Collaborator

@PaulHax PaulHax left a comment

Choose a reason for hiding this comment

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

Sweet feature. I can't seem to get it to export though 😅. Can it do something inteligent without setting --repo arg?

@@ -58,11 +81,21 @@ def __init__(self, server=None):
)

known_args, _ = self.server.cli.parse_known_args()
dataset_identifiers = expand_hugging_face_datasets(

self.state.input_datasets = expand_hugging_face_datasets(
Copy link
Collaborator

Choose a reason for hiding this comment

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

is input_datasets displayed by the GUI?

Comment on lines +33 to +34
self.context.setdefault("repository", "")
self.state.setdefault("current_dataset", "")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is set in core.py too. Should we refactor so we initialize the shared setup in once place?

Comment on lines +43 to +45
def on_server_ready(self, *args, **kwargs):
# Bind instance methods to state change
pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reason to keep?

Comment on lines +51 to +52
if self._exporting_dataset():
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

User could have stale images in the export if they change transforms, then click export again?

new_instance.set_parameters(instance.get_parameters())
transforms.append(new_instance)

# transforms = list(map(lambda t: t["instance"], self.context.transforms))
Copy link
Collaborator

Choose a reason for hiding this comment

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

🕵️

Path.mkdir(destination_dir, parents=True)

img = dataset.get_image(image_id)
img.load() # Avoid OSError(24, 'Too many open files')
Copy link
Collaborator

Choose a reason for hiding this comment

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

proably not needed in this loop?

return props.status === 'pending'
})

const barColor = computed(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Message text may help too, as I only get red and not sure if that is normal.

self.form_ui()

def form_ui(self):
with html.Div(trame_server=self.server):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is trame_server kwarg needed?

/>
<div class="q-gutter-sm">
<q-radio v-model="fullExport" :val="true" :disable="exporting" label="Full" />
<q-radio v-model="fullExport" :val="false" :disable="exporting" label="Selection" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<q-radio v-model="fullExport" :val="false" :disable="exporting" label="Selection" />
<q-radio v-model="fullExport" :val="false" :disable="exporting" label="Sampled" />

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

Successfully merging this pull request may close these issues.

Export transformed images along with model results
2 participants