Browse Source

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

qiufb 1 year ago
parent
commit
110650793d
1 changed files with 27 additions and 0 deletions
  1. 27 0
      classify-ai-backend/algo/car_cf.py

+ 27 - 0
classify-ai-backend/algo/car_cf.py

@@ -0,0 +1,27 @@
+import cv2
+import time
+import os
+import requests
+import pdb
+import asyncio
+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"]
+    if file_path.split(".")[-1] in file_format:
+        class_index = 0
+        i = int(class_index)
+        car_name = car_dict[i]
+        status = True
+    else:
+        status = False
+    return(car_name,status)