-
Notifications
You must be signed in to change notification settings - Fork 123
Upload image to dataset poc #5089
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
base: main
Are you sure you want to change the base?
Upload image to dataset poc #5089
Conversation
@@ -50,6 +50,8 @@ type Service interface { | |||
resource.Resource | |||
// Sync will sync data stored on the machine to the cloud. | |||
Sync(ctx context.Context, extra map[string]interface{}) error | |||
UploadImageToDataset(ctx context.Context, image []byte, datasetIDs, tags []string, |
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.
don't we need the mime type?
can we also have an image.Image version even if just for the go sdk?
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.
yes! we definitely should have the MIME type. Lemme add that.
Do you want the image.Image
version instead or in addition? If we pass in MIME type then it’s not an issue.
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.
Yes, I'd like both.
s.logger.Errorw("error reading file", "err", err) | ||
return err | ||
} | ||
s.syncArbitraryFile(f, tags, datasetIDs, 0, s.logger) |
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 this sync or async?
if we're writing to disk anyway, we can make async.
otherwise, let's not write to disk
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.
It should be async. The reason to write to disk is because all of our functionality is written to take in a os.File
and in the name of not rewriting everything just to account for this, thought it would be easier just to write to disk and delete it afterwards.
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.
Ok, just mark it as TODO please.
No description provided.