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

feat(blocks/nvidia): Add Nvidia deepfake detection block #9213

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

aarushik93
Copy link
Contributor

@aarushik93 aarushik93 commented Jan 7, 2025

Adding a block to allow users to detect deepfakes in their workflows.
This block takes in an image as input and returns the probability of it being a deepfake as well as the bounding boxes around the image.

Changes 🏗️

  • Added NvidiaDeepfakeDetectBlock
  • Added the ability to upload images on the frontend
  • Added the ability to render base64 encoded images on the frontend
Screenshot 2025-01-07 at 2 16 42 PM

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • ...
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

For configuration changes:

  • .env.example is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)
Examples of configuration changes
  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end platform/blocks size/l labels Jan 7, 2025
Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
🔨 Latest commit 0762389
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/677d46e087b6600008652a50

@aarushik93 aarushik93 changed the title Aarushikansal/nivida integration feat(blocks/nvidia): Add Nvidia deepfake detection block Jan 7, 2025
Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 0762389
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/677d46e09d4cb30008a6796b

@aarushik93 aarushik93 marked this pull request as ready for review January 7, 2025 14:26
@aarushik93 aarushik93 requested a review from a team as a code owner January 7, 2025 14:26
@aarushik93 aarushik93 requested review from Pwuts and Bentlybro and removed request for a team January 7, 2025 14:26
Copy link

qodo-merge-pro bot commented Jan 7, 2025

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 No relevant tests
🔒 Security concerns

API Key exposure:
The code exposes the Nvidia API key in the request headers. While it uses SecretStr for storage, the key is exposed in plaintext when making the API request. Consider using a more secure way to handle the API key, such as passing it through a secure proxy or using environment variables.

⚡ Recommended focus areas for review

Error Handling

The error handling in the run method could be improved. Currently it catches all exceptions generically and sets status to ERROR without distinguishing between different error types (API errors, network issues, etc).

except Exception as e:
    yield "error", str(e)
    yield "status", "ERROR"
    yield "is_deepfake", 0.0
    yield "image", ""
File Validation

The image file validation is minimal, only checking if file type starts with 'image/'. Consider adding size limits and more specific file type validation.

if (!file.type.startsWith("image/")) {
  console.error("Please upload an image file");
  return;
}

@aarushik93 aarushik93 added this pull request to the merge queue Jan 7, 2025
Merged via the queue into dev with commit b558cca Jan 7, 2025
22 checks passed
@aarushik93 aarushik93 deleted the aarushikansal/nivida-integration branch January 7, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants