Describe the bug
Why are the results different between rembg cli and rembg with new session with the same u2net model?
To Reproduce
Steps to reproduce the behavior:
When I run with command: rembg p path/to/input path/to/output
This is my result:
When I run with library:
from pathlib import Path
from rembg import remove, new_session
session = new_session()
for file in Path('path/to/folder').glob('*.png'):
input_path = str(file)
output_path = str(file.parent / (file.stem + ".out.png"))
with open(input_path, 'rb') as i:
with open(output_path, 'wb') as o:
input = i.read()
output = remove(input, session=session)
o.write(output)
This is my result
![2](https://github.com/danielgatis/rembg/assets/151597648/3d094695-71ec-474a-ab40-023533629c90)
**Difference two images**
![difference](https://github.com/danielgatis/rembg/assets/151597648/d21be3a0-67f3-4c01-b50f-c770e765eed7)
**Expected behavior**
After checking, I realized that two images are different. Can you help me fine-tune it to use a cli-like library?
Describe the bug Why are the results different between rembg cli and rembg with new session with the same u2net model?
To Reproduce Steps to reproduce the behavior:
When I run with command:
rembg p path/to/input path/to/output
This is my result:When I run with library:
for file in Path('path/to/folder').glob('*.png'): input_path = str(file) output_path = str(file.parent / (file.stem + ".out.png")) with open(input_path, 'rb') as i: with open(output_path, 'wb') as o: input = i.read() output = remove(input, session=session) o.write(output)