tdurbor commited on
Commit
9fca8a9
·
1 Parent(s): fda4281

Fix birefnet to 1024x1024

Browse files
utils/add_checkered_background.py CHANGED
@@ -63,7 +63,7 @@ def process_directory(input_dir, output_dir, square_size=20):
63
  with ThreadPoolExecutor() as executor:
64
  for root, _, files in os.walk(input_dir):
65
  for file in files:
66
- if file.lower().endswith(('.png', '.jpg', '.jpeg')):
67
  input_path = os.path.join(root, file)
68
  relative_path = os.path.relpath(input_path, input_dir)
69
  output_path = os.path.join(output_dir, os.path.splitext(relative_path)[0] + '.png')
 
63
  with ThreadPoolExecutor() as executor:
64
  for root, _, files in os.walk(input_dir):
65
  for file in files:
66
+ if file.lower().endswith(('.png', '.jpg', '.jpeg', '.webp')):
67
  input_path = os.path.join(root, file)
68
  relative_path = os.path.relpath(input_path, input_dir)
69
  output_path = os.path.join(output_dir, os.path.splitext(relative_path)[0] + '.png')
utils/birefnet.py CHANGED
@@ -24,7 +24,7 @@ async def remove_background_birefnet(image_path: str) -> Optional[str]:
24
  arguments={
25
  "image_url": image_path,
26
  "model": "General Use (Heavy)",
27
- "operating_resolution": "2048x2048",
28
  "output_format": "png",
29
  "refine_foreground": True
30
  }
 
24
  arguments={
25
  "image_url": image_path,
26
  "model": "General Use (Heavy)",
27
+ "operating_resolution": "1024x1024",
28
  "output_format": "png",
29
  "refine_foreground": True
30
  }