Inference.
Browse files
app/api/api_v1/endpoints/openai.py
CHANGED
|
@@ -176,10 +176,10 @@ async def create_collection(
|
|
| 176 |
pages = convert_from_bytes(results.content, 500, None, 1, 1)
|
| 177 |
cover = pages[0]
|
| 178 |
width, height = cover.size
|
| 179 |
-
target_width = round(width - (width * 0.
|
| 180 |
-
target_height = round(height - (height * 0.
|
| 181 |
cover = cover.resize((target_width, target_height), PIL.Image.Resampling.LANCZOS)
|
| 182 |
-
cover.save(tmp_file, optimize=True, quality=
|
| 183 |
tasks = label_studio_project.import_tasks(tmp_file)
|
| 184 |
os.remove(tmp_file)
|
| 185 |
|
|
|
|
| 176 |
pages = convert_from_bytes(results.content, 500, None, 1, 1)
|
| 177 |
cover = pages[0]
|
| 178 |
width, height = cover.size
|
| 179 |
+
target_width = round(width - (width * 0.8))
|
| 180 |
+
target_height = round(height - (height * 0.8))
|
| 181 |
cover = cover.resize((target_width, target_height), PIL.Image.Resampling.LANCZOS)
|
| 182 |
+
cover.save(tmp_file, optimize=True, quality=75)
|
| 183 |
tasks = label_studio_project.import_tasks(tmp_file)
|
| 184 |
os.remove(tmp_file)
|
| 185 |
|