-
Notifications
You must be signed in to change notification settings - Fork 1
/
user.py
57 lines (49 loc) · 1.64 KB
/
user.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
# coding=UTF-8
from datetime import datetime
from pathlib import Path
from chart_analyze import apex_chart_analyze
from video_ocr_read_opencv import read_apex_video
def full_analyze_apex_video(
video_path: Path,
output_evnchart_path: Path,
output_fl_path: Path,
output_original_path: Path,
rank_league: bool | None = None,
):
Path('./Temp').mkdir(parents=True, exist_ok=True)
Path('./BigData').mkdir(parents=True, exist_ok=True)
Path('./Output').mkdir(parents=True, exist_ok=True)
FRAMES, WEAPONS, AMMOS, DAMAGES, total_frames, fps = read_apex_video(
video_path=video_path,
output_original_data=output_original_path,
rank_league=rank_league,
)
apex_chart_analyze(
video_path=video_path,
FRAMES=FRAMES,
WEAPONS=WEAPONS,
AMMOS=AMMOS,
DAMAGES=DAMAGES,
TOTAL_FRAMES=total_frames,
FPS=fps,
eventchart_path=output_evnchart_path,
fl_path=output_fl_path,
saveto_bigdata=True,
)
def main():
video_path = Path('F:/MEDIA/APEX/online/Apex Legends_06-16-2023_20-17-34-164.mp4')
# video_path = Path('# Your APEX Video')
evnchart_path = Path('./Temp/event_chart.feather')
fl_path = Path('./Temp/firing_list.feather')
original_data_path = Path('./Temp/readdata_original.feather')
tic = datetime.now()
full_analyze_apex_video(
video_path,
output_fl_path=fl_path,
output_evnchart_path=evnchart_path,
output_original_path=original_data_path,
)
toc = datetime.now()
print(f'Elapsed time: {(toc - tic).total_seconds()} seconds')
if __name__ == '__main__':
main()