Hugging Face
Models
Datasets
Spaces
Posts
Docs
Solutions
Pricing
Log In
Sign Up
Spaces:
mtalamon
/
try
like
0
Sleeping
App
Files
Files
Community
1c882b4
try
/
utils.py
mtalamon
Upload 5 files
1bc2204
verified
10 months ago
raw
Copy download link
history
blame
Safe
180 Bytes
import
math
def
extract_point
(
obj, pt
):
return
obj.width*pt.x,obj.height* pt.y
def
compute_distance
(
pt1, pt2
):
return
math.sqrt((pt1[
0
]- pt2[
0
])**
2
+ (pt1[
1
]- pt2[
1
])**
2
)