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

fixed annotated image download from docker #60

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ docker-compose up -d #running in detached mode
```
The application should be running on [http://localhost](http://localhost).

**Note:** The downloading functionality is currently **not supported** when running the application within a Docker container.

## Running Tests

### Client Tests
Expand Down
10 changes: 10 additions & 0 deletions server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ def download_image_with_annotations():

for image_info in images:
image_url = image_info.get("regions", [])[0].get("image-src")

# Docker container uses port 5000, so replace 5001 with 5000
if "127.0.0.1:5001" in image_url:
image_url = image_url.replace("127.0.0.1:5001", "127.0.0.1:5000")

response = requests.get(image_url)
image = Image.open(BytesIO(response.content))
draw = ImageDraw.Draw(image)
Expand Down Expand Up @@ -365,6 +370,11 @@ def download_image_mask():

for image_info in images:
image_url = image_info.get("regions", [])[0].get("image-src")

# Docker container uses port 5000, so replace 5001 with 5000
if "127.0.0.1:5001" in image_url:
image_url = image_url.replace("127.0.0.1:5001", "127.0.0.1:5000")

response = requests.get(image_url)
image = Image.open(BytesIO(response.content))
width, height = image.size
Expand Down
Loading