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

s3 url as input folder #154

Open
1 task done
pythonstuff8 opened this issue May 19, 2024 · 3 comments
Open
1 task done

s3 url as input folder #154

pythonstuff8 opened this issue May 19, 2024 · 3 comments
Labels
question Further information is requested

Comments

@pythonstuff8
Copy link

Search before asking

  • I have searched the Autodistill issues and found no similar feature requests.

Question

How do I use my s3 bucket folder url as the input folder variable:


ontology=CaptionOntology({
    f"thing": f"thing"

})
from autodistill_grounded_sam import GroundedSAM

base_model = GroundedSAM(ontology=ontology)
dataset = base_model.label(
    input_folder="s3://bucket/folder/",
    extension=".jpg",
    output_folder="outputf")```

### Additional

this line 'input_folder="s3://bucket/folder",` could also be `input_folder="https://bucket.s3.amazonaws.com/folder/",`
@pythonstuff8 pythonstuff8 added the question Further information is requested label May 19, 2024
@capjamesg
Copy link
Member

capjamesg commented May 20, 2024

Hello there! We don't currently have direct support for running Autodistill on an S3 bucket. With that said, you can download your images from S3 to the computer on which you are running Autodistill with a few commands.

To download data from AWS, first install the awscli command line tool. This tool allows you to interact with your AWS account on the command line. Once you have the command line tool installed, run the following command:

aws s3 sync s3://mybucket/folder_path .

Replace mybucket with the name of your bucket and folder_path with the name of the folder or file you want to export. This comamnd will download an asset from AWS to your current working directory (.).

@pythonstuff8
Copy link
Author

pythonstuff8 commented May 23, 2024

thank you, I will wait until support comes ... I also have to files stored as PIL images in a varible can I use those `original_image=original_image.resize((224,224))

rotated_image = original_image.rotate(-30)



rotated_image2 = original_image.rotate(30)



flipped_image = original_image.transpose(Image.FLIP_LEFT_RIGHT)



blurred_image = original_image.filter(ImageFilter.GaussianBlur(radius=2))


enhancer = ImageEnhance.Brightness(original_image)
brightened_image = enhancer.enhance(1.5)


darkened_image = enhancer.enhance(0.5)

noisy_image = add_noise(original_image, noise_factor=50)  # Adjust noise_factor as needed
try:
    inverted_image = ImageOps.invert(original_image)
except:
   pass
grayscale_image = original_image.convert("L")
return original_image,rotated_image,rotated_image2,flipped_image,blurred_image,brightened_image,darkened_image,noisy_image,inverted_image,grayscale_image`

@pythonstuff8
Copy link
Author

@capjamesg

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

No branches or pull requests

2 participants