GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add colorize() (v0.1.0) — DDColor image colorization · useknockout/python@e9cc90b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • pyproject.toml
  • src/useknockout
    • _version.py
    • async_client.py
    • client.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎pyproject.toml‎

Copy file name to clipboardExpand all lines: pyproject.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "useknockout"
7-
version = "0.0.4"
7+
version = "0.1.0"
88
description = "Python SDK for useknockout — state-of-the-art background removal API."
99
readme = "README.md"
1010
license = { text = "MIT" }
Collapse file

‎src/useknockout/_version.py‎

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.4"
1+
__version__ = "0.1.0"
Collapse file

‎src/useknockout/async_client.py‎

Copy file name to clipboardExpand all lines: src/useknockout/async_client.py
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,17 @@ async def face_restore(
362362
files=_multipart_files(file),
363363
data=_form({"only_center_face": only_center_face, "format": format}),
364364
)
365+
366+
async def colorize(
367+
self,
368+
file: FileInput,
369+
*,
370+
format: str = "png",
371+
) -> bytes:
372+
"""POST /colorize — DDColor (Apache-2.0) image colorization. Async."""
373+
return await self._request_bytes(
374+
"POST",
375+
"/colorize",
376+
files=_multipart_files(file),
377+
data=_form({"format": format}),
378+
)
Collapse file

‎src/useknockout/client.py‎

Copy file name to clipboardExpand all lines: src/useknockout/client.py
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,3 +403,25 @@ def face_restore(
403403
files=_multipart_files(file),
404404
data=_form({"only_center_face": only_center_face, "format": format}),
405405
)
406+
407+
def colorize(
408+
self,
409+
file: FileInput,
410+
*,
411+
format: str = "png",
412+
) -> bytes:
413+
"""POST /colorize — DDColor (Apache-2.0) image colorization.
414+
415+
Predicts plausible color from grayscale luminance via a ConvNeXt-Large
416+
backbone (single feed-forward, ~500ms warm). Works on B&W or color
417+
input — color images are converted to grayscale internally before
418+
prediction, which makes round-trip recoloring straightforward.
419+
420+
Added in v0.1.0; requires API ≥ v0.7.0.
421+
"""
422+
return self._request_bytes(
423+
"POST",
424+
"/colorize",
425+
files=_multipart_files(file),
426+
data=_form({"format": format}),
427+
)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.