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

Content Moderation without extension #327

Closed
Livijn opened this issue Jan 20, 2022 · 6 comments
Closed

Content Moderation without extension #327

Livijn opened this issue Jan 20, 2022 · 6 comments
Labels

Comments

@Livijn
Copy link

Livijn commented Jan 20, 2022

According to this comment you have disabled Amazon Rekognition for files without extensions. Is there any way around this? None of my files has extensions. Can I fake the extension somehow? Or would I need to rename every single file (there are tens of thousands)?

We've added limited support for files without extensions in v5.2.0. Any image filters that use Amazon Rekognition (content moderation and smart cropping) will not work with files that do not have an extension.

Originally posted by @G-Lenz in #188 (comment)

@Livijn Livijn changed the title We've added limited support for files without extensions in v5.2.0. Any image filters that use Amazon Rekognition (content moderation and smart cropping) will not work with files that do not have an extension. Content Moderation without extension Jan 20, 2022
@fisenkodv
Copy link
Contributor

@Livijn you can apply edits that use Amazon Rekognition (content moderation and smart cropping) for files without extensions, for example:

  • for contentModeration
{
"bucket": "bucket_name",
"key": "file_name_without_extension",
  "edits": {
    "contentModeration": {
      "minConfidence": 90,
      "blur": 100,
      "moderationLabels": [
        "Smoking"
      ]
    }
  }
}
  • for smartCrop
{
  "bucket": "bucket_name",
  "key": "file_name_without_extension",
  "edits": {
    "smartCrop": {
      "faceIndex": 1
    }
  }
}

@Livijn
Copy link
Author

Livijn commented Jan 27, 2022

When I use that I get this:

{
  "status": 500,
  "code": "UnknownEndpoint",
  "message": "Inaccessible host: `rekognition.eu-west-3.amazonaws.com' at port `undefined'. This service may not be available in the `eu-west-3' region."
}

Here is an example URL: https://d1itmprkv0mcqg.cloudfront.net/eyJidWNrZXQiOiJkb2dzLW1haW4iLCJrZXkiOiJjb250ZW50XC83OTI5NDk4OC1jYTUxLTQzYWEtODM3Ni1jZWI3NmViNThhZTQiLCJlZGl0cyI6eyJ3ZWJwIjp7InF1YWxpdHkiOjgwfSwianBlZyI6eyJxdWFsaXR5Ijo4MH0sInJlc2l6ZSI6eyJ3aWR0aCI6ODAwLCJoZWlnaHQiOjgwMCwiZml0IjoiY292ZXIifSwiY29udGVudE1vZGVyYXRpb24iOnsibWluQ29uZmlkZW5jZSI6OTAsImJsdXIiOjEwMCwibW9kZXJhdGlvbkxhYmVscyI6WyJTbW9raW5nIl19fX0=

And base64 decoded:

{
  "bucket": "dogs-main",
  "key": "content/79294988-ca51-43aa-8376-ceb76eb58ae4",
  "edits": {
    "webp": {
      "quality": 80
    },
    "jpeg": {
      "quality": 80
    },
    "resize": {
      "width": 800,
      "height": 800,
      "fit": "cover"
    },
    "contentModeration": {
      "minConfidence": 90,
      "blur": 100,
      "moderationLabels": [
        "Smoking"
      ]
    }
  }
}

@fisenkodv
Copy link
Contributor

Amazon Rekognition is not available in the eu-west-3 region, please refer to the Service endpoints section here https://docs.aws.amazon.com/general/latest/gr/rekognition.html to see the list of supported regions.

@Livijn
Copy link
Author

Livijn commented Jan 28, 2022

Oh crap. Is there a way to migrate to another region without having to reupload all my files?

@fisenkodv
Copy link
Contributor

You could use the same source bucket and launch the solution. Unless it's an opt-in region, it should support using a source bucket in different regions. When you launch the solution in a different region, every infrastructure resource is going to be provisioned again (e.g. CF, API Gateway) in that region.

@Livijn
Copy link
Author

Livijn commented Jan 28, 2022

Ok, thanks for your help 👍

@Livijn Livijn closed this as completed Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants