ソースを参照

上传文件至 'classify-ai-backend/algo'

qiufb 1 年間 前
コミット
eca8c3ff3b
1 ファイル変更11 行追加8 行削除
  1. 11 8
      classify-ai-backend/algo/car_cf.py

+ 11 - 8
classify-ai-backend/algo/car_cf.py

@@ -8,15 +8,18 @@ import websockets
 import json
 import threading
 
+
 def car_classification(file_path):
 
-    car_dict = {0:"tank",
-            1:"zhuangjc",
-            2:"jiefc",
-            3:"lvdc",
-            4:"lunsc",
-            5:"daodc"}
-    file_format = ["txt","npy","xls","wav","json"]
+    car_dict = {
+        0: "tank",
+        1: "zhuangjc",
+        2: "jiefc",
+        3: "lvdc",
+        4: "lunsc",
+        5: "daodc"
+    }
+    file_format = ["txt", "npy", "xls", "wav", "json"]
     if file_path.split(".")[-1] in file_format:
         class_index = 0
         i = int(class_index)
@@ -24,4 +27,4 @@ def car_classification(file_path):
         status = True
     else:
         status = False
-    return(car_name,status)
+    return (status, car_name)