cm107 commited on
Commit
26d88b0
1 Parent(s): 5bf29aa

Upgrade python version to 3.10.4

Browse files
Files changed (2) hide show
  1. README.md +1 -0
  2. mypkg/draw.py +6 -6
README.md CHANGED
@@ -4,6 +4,7 @@ emoji: 👁
4
  colorFrom: indigo
5
  colorTo: red
6
  sdk: gradio
 
7
  sdk_version: 3.12.0
8
  app_file: app.py
9
  pinned: false
 
4
  colorFrom: indigo
5
  colorTo: red
6
  sdk: gradio
7
+ python_version: 3.10.4
8
  sdk_version: 3.12.0
9
  app_file: app.py
10
  pinned: false
mypkg/draw.py CHANGED
@@ -4,7 +4,7 @@ import numpy.typing as npt
4
 
5
  def blank(
6
  width: int=500, height: int=500,
7
- background: tuple=(0,0,0)
8
  ) -> npt.NDArray[np.uint8]:
9
  img = np.zeros((height, width, 3), dtype=np.uint8)
10
  img[:, :, :] = background
@@ -13,8 +13,8 @@ def blank(
13
  def circle(
14
  width: int=500, height: int=500,
15
  radius: int=None,
16
- color: tuple=(0,0,255),
17
- background: tuple=(0,0,0)
18
  ) -> npt.NDArray[np.uint8]:
19
  if radius is None:
20
  radius = int(0.5 * max(width, height) * 0.8)
@@ -27,9 +27,9 @@ def circle(
27
 
28
  def rectangle(
29
  width: int=500, height: int=500,
30
- pt1: tuple=None, pt2: tuple=None,
31
- color: tuple=(0,0,255),
32
- background: tuple=(0,0,0)
33
  ) -> npt.NDArray[np.uint8]:
34
  img = blank(
35
  width=width, height=height,
 
4
 
5
  def blank(
6
  width: int=500, height: int=500,
7
+ background: tuple[int, int, int]=(0,0,0)
8
  ) -> npt.NDArray[np.uint8]:
9
  img = np.zeros((height, width, 3), dtype=np.uint8)
10
  img[:, :, :] = background
 
13
  def circle(
14
  width: int=500, height: int=500,
15
  radius: int=None,
16
+ color: tuple[int, int, int]=(0,0,255),
17
+ background: tuple[int, int, int]=(0,0,0)
18
  ) -> npt.NDArray[np.uint8]:
19
  if radius is None:
20
  radius = int(0.5 * max(width, height) * 0.8)
 
27
 
28
  def rectangle(
29
  width: int=500, height: int=500,
30
+ pt1: tuple[int, int]=None, pt2: tuple[int, int]=None,
31
+ color: tuple[int, int, int]=(0,0,255),
32
+ background: tuple[int, int, int]=(0,0,0)
33
  ) -> npt.NDArray[np.uint8]:
34
  img = blank(
35
  width=width, height=height,