-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: main
Are you sure you want to change the base?
Conversation
919dcdf
to
de9864c
Compare
de9864c
to
247a556
Compare
There was a problem hiding this 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( |
There was a problem hiding this comment.
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?
self.context.setdefault("repository", "") | ||
self.state.setdefault("current_dataset", "") |
There was a problem hiding this comment.
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?
def on_server_ready(self, *args, **kwargs): | ||
# Bind instance methods to state change | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason to keep?
if self._exporting_dataset(): | ||
return |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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(() => { |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<q-radio v-model="fullExport" :val="false" :disable="exporting" label="Selection" /> | |
<q-radio v-model="fullExport" :val="false" :disable="exporting" label="Sampled" /> |
Related to #126