Skip to content

Commit

Permalink
Use MASK_BACKGROUND_COLOR in download_image_mask
Browse files Browse the repository at this point in the history
Use the MASK_BACKGROUND_COLOR loaded from config.py in download_image_mask
  • Loading branch information
Mews authored and sumn2u committed Jun 10, 2024
1 parent 7fe6162 commit 71cdd47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from dotenv import load_dotenv

app = Flask(__name__)
app.config.from_object("config")


# Get the CLIENT_URL environment variable, set a default if not found
Expand Down Expand Up @@ -341,7 +342,7 @@ def download_image_mask():
response = requests.get(image_url)
image = Image.open(BytesIO(response.content))
width, height = image.size
mask = Image.new('RGB', (width, height), (0, 0, 0)) # 'RGB' mode for colored masks
mask = Image.new('RGB', (width, height), app.config["MASK_BACKGROUND_COLOR"]) # 'RGB' mode for colored masks
draw = ImageDraw.Draw(mask)

for region in image_info.get("regions", []):
Expand Down

0 comments on commit 71cdd47

Please sign in to comment.