-
Notifications
You must be signed in to change notification settings - Fork 1
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
Layout and minimal changes #23
Conversation
Of negligible importance to us but the change to |
Super happy with this, ideally want to merge #22 first so there aren't conflicts over layout, it's a good trigger to nudge the relevant people |
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.
Thank you! Let's get the whole stack of these improvements merged in when you're back on Thursday
|
||
# Check if the input is a single image or a batch | ||
if len(tensor_image.shape) == 3: | ||
# Single image, add a batch dimension | ||
tensor_image = tensor_image.unsqueeze(0) | ||
|
||
# Check if CUDA is available and move the tensor to the CUDA device | ||
if torch.cuda.is_available(): | ||
tensor_image = tensor_image.cuda() |
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.
I haven't tested any of this with a GPU machine, i remember you noticing that the model wasn't moved to CUDA when you ran it with GPU available, it's probably better to do that than remove the half-implemented option?
|
||
[tool.jupytext] | ||
formats = "ipynb,md" | ||
|
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.
Thank you for this incremental refinement, moving to the "src layout" was also on my inward list now I've been convinced of the benefits
This PR collects a small handful of changes which I'm hoping are sufficiently non-contentious to bundle together.
src/
layout.[build-system]
table topyproject.toml
(using setuptools for now)prepare_image
that moves the tensor to the default cuda device if availableAs a side note, the main motivation was that I was experiencing a few problems just
pip install
ing the package in editable mode, which made me feel like I was 20 again and unable to figure out why I couldn't import the package I'd just installed. Completing thepyproject.toml
and changing tosrc/
fixed these issues today, as it happened.