Skip to content

Add python example - #8

Open
dh7 wants to merge 15 commits into
mainfrom
add_python_example
Open

Add python example#8
dh7 wants to merge 15 commits into
mainfrom
add_python_example

Conversation

@dh7

@dh7dh7 commented Jun 8, 2022

Copy link
Copy Markdown

No description provided.

@vercel

vercelBot commented Jun 8, 2022

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

NameStatusPreviewUpdated
clipdrop-api-sample-decompose-layers✅ Ready (Inspect)Visit PreviewJun 22, 2022 at 7:21AM (UTC)
clipdrop-api-samples-text-remover✅ Ready (Inspect)Visit PreviewJun 22, 2022 at 7:21AM (UTC)
remove-objects-tfjs✅ Ready (Inspect)Visit PreviewJun 22, 2022 at 7:21AM (UTC)
sample-logo-removal❌ Failed (Inspect)Jun 22, 2022 at 7:21AM (UTC)
sample-person-removal❌ Failed (Inspect)Jun 22, 2022 at 7:21AM (UTC)
1 Ignored Deployment
NameStatusPreviewUpdated
remove-background-bulk⬜️ Ignored (Inspect)Jun 22, 2022 at 7:21AM (UTC)

@jblanchejblanche left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a cleanup example too ?

Comment threadpython/clipdrop.py
"""call the API to remove the background"""
output_format = os.path.splitext(output_file)[1].lower()
img_in = open(input_file, 'rb')
files = {'image_file': ('image.jpeg', img_in, 'image/jpeg')}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the input image is a webp / png ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't matter. I've tryed with png and it work (ligne 53). It seems that neither the API or the services cares

Comment threadpython/clipdrop.py
Comment threadpython/clipdrop.py
Comment threadpython/clipdrop.py Outdated
Comment threadpython/clipdrop.py Outdated
Comment threadpython/clipdrop.py
Comment threadpython/clipdrop.py
Comment threadpython/clipdrop.py Outdated
Comment threadpython/clipdrop.py
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed! Quality Gate passed

BugA0 Bugs
VulnerabilityA0 Vulnerabilities
Security HotspotA0 Security Hotspots
Code SmellA4 Code Smells

No Coverage information No Coverage information
0.0%0.0% Duplication

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@dh7@jblanche