Spaces:
Runtime error
Runtime error
Download seg/models/utils/class_overlapping.py from LXT/OMG_Seg: direct link, hf CLI and curl.
- Browser
- Download file 420 Bytes
-
https://huggingface.co/spaces/LXT/OMG_Seg/resolve/main/seg/models/utils/class_overlapping.py
- Command line
-
hf download hf://spaces/LXT/OMG_Seg/seg/models/utils/class_overlapping.py
-
curl -L -o class_overlapping.py https://huggingface.co/spaces/LXT/OMG_Seg/resolve/main/seg/models/utils/class_overlapping.py
420 Bytes
| from typing import List | |
| def calculate_class_overlapping(classes1: List[str], classes2: List[str]) -> List[bool]: | |
| words1 = [word for item in classes1 for word in item.split(',')] | |
| results = [] | |
| for item in classes2: | |
| flag: bool = False | |
| for word in item.split(','): | |
| if word in words1: | |
| flag = True | |
| break | |
| results.append(flag) | |
| return results | |