File size: 4,671 Bytes
68286c7 |
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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "47558924-cc59-4f1e-a6e4-7c9df75b8492",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(32, 32, 3)"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import cv2\n",
"img = cv2.imread(\"v3/test/FAKE/0 (2).jpg\")\n",
"img.shape"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "cd439f69-1257-4505-8c23-90b521ba078c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting opencv-python\n",
" Using cached opencv_python-4.11.0.86-cp37-abi3-macosx_13_0_arm64.whl.metadata (20 kB)\n",
"Requirement already satisfied: numpy>=1.21.2 in /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages (from opencv-python) (2.1.3)\n",
"Using cached opencv_python-4.11.0.86-cp37-abi3-macosx_13_0_arm64.whl (37.3 MB)\n",
"Installing collected packages: opencv-python\n",
"Successfully installed opencv-python-4.11.0.86\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip install opencv-python"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "4c491c03-781b-40ec-af11-f621bd1098ad",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import torch\n",
"torch.arange(400000)\n",
"torch.mps.is_available()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1b83e62a-1c07-4720-8368-5050df60c7f8",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 3,
"id": "0272f35d-ad13-4f13-9e95-f1e2159139fa",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33mWARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x10660c440>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/opencv-python/\u001b[0m\u001b[33m\n",
"\u001b[0m\u001b[33mWARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x106581950>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/opencv-python/\u001b[0m\u001b[33m\n",
"\u001b[0m\u001b[33mWARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x106581a90>: Failed to establish a new connection: [Errno 51] Network is unreachable')': /simple/opencv-python/\u001b[0m\u001b[33m\n",
"\u001b[0m\u001b[33mWARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x106581bd0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/opencv-python/\u001b[0m\u001b[33m\n",
"\u001b[0m\u001b[33mWARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x106581e50>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/opencv-python/\u001b[0m\u001b[33m\n",
"\u001b[0m\u001b[31mERROR: Could not find a version that satisfies the requirement opencv-python (from versions: none)\u001b[0m\u001b[31m\n",
"\u001b[0m\u001b[31mERROR: No matching distribution found for opencv-python\u001b[0m\u001b[31m\n",
"\u001b[0m"
]
}
],
"source": [
"!pip install opencv-python"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|