简体   繁体   English

使用python和fiftyone api将文件上传到s3

[英]Uploading file to s3 using python and fiftyone api

I am trying to create an automated pipeline that gets files from this api fiftyone and load it to s3.我正在尝试创建一个自动化管道,从这个 api 五十一获取文件并将其加载到 s3。 From what I saw the fiftyone package can only download it locally.从我看到的五十一个包只能在本地下载。

import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset(
"open-images-v6",
split="validation",
classes=["Cat","Dog"],
max_samples=100,
label_types=["detections"],
seed=51,
dataset_name="open-images-pets"

Thats the code I use to download the files, thing is they download locally.那是我用来下载文件的代码,事情是它们在本地下载。 Anyone that has some experience with this and how could this be done?任何对此有一些经验的人以及如何做到这一点?

Thank you!谢谢!

You're right that the code snippet that you shared will download the files from Open Images to whatever local machine you are working on.没错,您共享的代码片段会将文件从 Open Images 下载到您正在处理的任何本地计算机上。 From there, you can use something like boto3 to upload the files to s3.从那里,您可以使用类似 boto3 的东西将文件上传到 s3。 Then, you may want to check out the examples for using s3fs-fuse and FiftyOne to see how you can mount those cloud files and use them in FiftyOne.然后,您可能想查看使用s3fs-fuse和 FiftyOne的示例,了解如何挂载这些云文件并在 FiftyOne 中使用它们。

Directly using FiftyOne inside of a Sagemaker notebook is in development.在 Sagemaker 笔记本中直接使用 FiftyOne 正在开发中。

Note that FiftyOne Teams has more support for cloud data, with methods to upload/download to the cloud and use cloud objects directly rather than with s3fs-fuse .请注意, FiftyOne Teams对云数据有更多支持,包括上传/下载到云和直接使用云对象的方法,而不是使用s3fs-fuse

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM