|
|
@@ -1,5 +1,6 @@
|
|
|
from video_to_photo import run
|
|
|
import os
|
|
|
+import advice
|
|
|
|
|
|
def classify_jump(name,re):
|
|
|
q="./capture_image/"+name
|
|
|
@@ -48,7 +49,7 @@ def classify_jump(name,re):
|
|
|
a=os.path.join(qqq,r)
|
|
|
result["landing_position"]["path"]=a
|
|
|
result["landing_position"]["val"]=re["3"]["val"]
|
|
|
-
|
|
|
+ result["advice"]= advice.ad_jump(result)
|
|
|
|
|
|
return result
|
|
|
def classify_juanfu(name,re):
|
|
|
@@ -73,11 +74,11 @@ def classify_juanfu(name,re):
|
|
|
result["head_power"]["val"]=re["1"]["val"]
|
|
|
|
|
|
result["core_strength"]={}
|
|
|
- if(float(re["2"]["val"])>75):
|
|
|
+ if(float(re["2"]["val"])>90):
|
|
|
result["core_strength"]["level"]=1
|
|
|
- elif (float(re["2"]["val"])>70):
|
|
|
+ elif (float(re["2"]["val"])>80):
|
|
|
result["core_strength"]["level"]=2
|
|
|
- elif (float(re["2"]["val"])>60):
|
|
|
+ elif (float(re["2"]["val"])>70):
|
|
|
result["core_strength"]["level"]=3
|
|
|
else:
|
|
|
result["core_strength"]["level"]=4
|
|
|
@@ -88,15 +89,16 @@ def classify_juanfu(name,re):
|
|
|
result["body_stability"]={}
|
|
|
if(float(re["4"]["num"])<15):
|
|
|
result["body_stability"]["level"]=1
|
|
|
- elif (float(re["4"]["val"])<20):
|
|
|
+ elif (float(re["4"]["num"])<20):
|
|
|
result["body_stability"]["level"]=2
|
|
|
- elif (float(re["4"]["val"])<30):
|
|
|
+ elif (float(re["4"]["num"])<30):
|
|
|
result["body_stability"]["level"]=3
|
|
|
else:
|
|
|
result["body_stability"]["level"]=4
|
|
|
|
|
|
|
|
|
result["body_stability"]["val"]=re["4"]["num"]
|
|
|
+ result["advice"]=advice.ad_juanfu(result)
|
|
|
return result
|
|
|
|
|
|
def classify_pingban(name,re):
|
|
|
@@ -148,7 +150,7 @@ def classify_pingban(name,re):
|
|
|
a=os.path.join(qqq,r)
|
|
|
result["standard"]["path"]=a
|
|
|
result["standard"]["val"]=re["3"]["val"]
|
|
|
-
|
|
|
+ result["advice"]=advice.ad_pingban(result)
|
|
|
|
|
|
return result
|
|
|
def classify_shendun(name,re):
|
|
|
@@ -168,6 +170,7 @@ def classify_shendun(name,re):
|
|
|
r="capture_image"+str(re["1"]["num"])+".png"
|
|
|
a=os.path.join(qqq,r)
|
|
|
result["leg_strength"]["path"]=a
|
|
|
+ result["advice"]=advice.ad_shendun(result)
|
|
|
return result
|
|
|
def classify_gaotaitui(name,re):
|
|
|
q="./capture_image/"+name
|
|
|
@@ -186,6 +189,7 @@ def classify_gaotaitui(name,re):
|
|
|
r="capture_image"+str(re["1"]["num"])+".png"
|
|
|
a=os.path.join(qqq,r)
|
|
|
result["standard"]["path"]=a
|
|
|
+ result["advice"]=advice.ad_gaotaitui(result)
|
|
|
return result
|
|
|
|
|
|
|
|
|
@@ -204,27 +208,28 @@ def classify_result(video_path,re,mode):
|
|
|
'gaotaitui':classify_gaotaitui,
|
|
|
}
|
|
|
choice=mode
|
|
|
- power=switch.get(choice,classify_jump)(video_path,re)
|
|
|
+ power=switch.get(choice,classify_jump)(name,re)
|
|
|
+ print(power)
|
|
|
return power
|
|
|
|
|
|
-def api_dyna(video_path,mode,ana=1):
|
|
|
+def api_dyna(path,mode,ana):
|
|
|
return classify_result(path,run(path,mode,ana),mode)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
|
|
|
- path="./video/demo1.mp4"
|
|
|
- api_dyna(path,"jump",0)
|
|
|
+ #path="./video/demo1.mp4"
|
|
|
+ #api_dyna(path,"jump",0)
|
|
|
#classify_result(path,run(path,"jump",0),"jump")
|
|
|
- path="./video/juanfu.mp4"
|
|
|
- api_dyna(path,"juanfu",0)
|
|
|
+ #path="./video/juanfu.mp4"
|
|
|
+ #api_dyna(path,"juanfu",0)
|
|
|
#classify_result(path,run(path,"juanfu",0),"juanfu")
|
|
|
path="./video/pingban.mp4"
|
|
|
api_dyna(path,"pingban",0)
|
|
|
- #classify_result(path,run(path,"pingban",0),"pingban")
|
|
|
+ classify_result(path,run(path,"pingban",0),"pingban")
|
|
|
path="./video/gaotaitui.mp4"
|
|
|
api_dyna(path,"gaotaitui",0)
|
|
|
- #classify_result(path,run(path,"gaotaitui",0),"gaotaitui")
|
|
|
+ classify_result(path,run(path,"gaotaitui",0),"gaotaitui")
|
|
|
path="./video/shendun.mp4"
|
|
|
api_dyna(path,"shendun",0)
|
|
|
'''
|