-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_imports.py
More file actions
63 lines (52 loc) · 1.48 KB
/
test_imports.py
File metadata and controls
63 lines (52 loc) · 1.48 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python3
"""
Test script to check if all imports work correctly
"""
print("🔄 Testing imports...")
try:
print(" - Testing Flask...")
from flask import Flask, request, jsonify
print(" ✅ Flask OK")
except Exception as e:
print(f" ❌ Flask failed: {e}")
try:
print(" - Testing PIL...")
from PIL import Image
print(" ✅ PIL OK")
except Exception as e:
print(f" ❌ PIL failed: {e}")
try:
print(" - Testing OpenCV...")
import cv2
print(f" ✅ OpenCV OK (version: {cv2.__version__})")
except Exception as e:
print(f" ❌ OpenCV failed: {e}")
try:
print(" - Testing dlib...")
import dlib
print(" ✅ dlib OK")
except Exception as e:
print(f" ❌ dlib failed: {e}")
try:
print(" - Testing MediaPipe...")
import mediapipe as mp
print(" ✅ MediaPipe OK")
except Exception as e:
print(f" ❌ MediaPipe failed: {e}")
try:
print(" - Testing torch...")
import torch
print(f" ✅ PyTorch OK (version: {torch.__version__})")
# Test basic tensor operations
print(" - Testing torch tensor...")
x = torch.tensor([1, 2, 3])
print(f" ✅ Tensor creation OK: {x}")
except Exception as e:
print(f" ❌ PyTorch failed: {e}")
try:
print(" - Testing numpy...")
import numpy as np
print(f" ✅ NumPy OK (version: {np.__version__})")
except Exception as e:
print(f" ❌ NumPy failed: {e}")
print("🎉 Import test completed!")