-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathsample_system_resource_statistics.py
More file actions
36 lines (33 loc) · 1.05 KB
/
sample_system_resource_statistics.py
File metadata and controls
36 lines (33 loc) · 1.05 KB
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
import inspireface as isf
import click
@click.command()
@click.argument("resource_path")
def case_show_system_resource_statistics(resource_path):
"""
This case is used to test the system resource statistics.
"""
ret = isf.launch(resource_path)
assert ret, "Launch failure. Please ensure the resource path is correct."
print("-" * 100)
print("Initialization state")
print("-" * 100)
isf.show_system_resource_statistics()
print("-" * 100)
print("Create 10 sessions")
print("-" * 100)
print("")
num_created_sessions = 10
sessions = []
for i in range(num_created_sessions):
session = isf.InspireFaceSession(isf.HF_ENABLE_FACE_RECOGNITION, isf.HF_DETECT_MODE_ALWAYS_DETECT)
sessions.append(session)
isf.show_system_resource_statistics()
print("-" * 100)
print("Release 10 sessions")
print("-" * 100)
print()
for session in sessions:
session.release()
isf.show_system_resource_statistics()
if __name__ == "__main__":
case_show_system_resource_statistics()