-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.py
63 lines (52 loc) · 1.02 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from utils.version import get_versions
import numpy as np
def nms_numpy(boxes):
"""
args:
boxes (array (n, 5))
return:
keep (array, (n,))
"""
box = boxes[:, :4]
scores = boxes[:,4]
inds = boxes.argsort()[::-1]
while inds.size() > 1:
pass
def check_list():
l1 = []
l1.append(1)
l1.extend([2,3])
l1.insert(-1, 200)
def check_random():
a = np.random.randn(2,4)
print(a)
def check_dict():
d = dict(a= 1, b =2)
print(d)
d1 = dict(a=2, b=3)
d2 = dict(c=4,d=5)
d = dict(**d1, **d2)
print(d)
def check_set():
a = {1,3,4,3,1}
b = {3,1,2,4,2}
print(a)
c = a | b
print(c)
def sort():
np.random.seed(12)
a = np.random.randn(2,4)
print(a)
c = [i * 3 for i in range(3)]
print(c)
b = np.array([4,7,3,6,4,9,1])
b = sorted(b)
d = argsort(b)
print(b)
print(d)
if __name__ == "__main__":
check_list()
check_random()
check_dict()
check_set()
sort()