objectvisions 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Naman Lohiya
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.4
2
+ Name: objectvisions
3
+ Version: 0.0.1
4
+ Summary: Real-time Object Detection using OpenCV DNN
5
+ Author-email: Naman Lohiya <your_email@gmail.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: opencv-python
11
+ Requires-Dist: numpy
12
+ Dynamic: license-file
13
+
14
+ # ObjectVision-Naman 🚀
15
+
16
+ Real-time Object Detection Library built using OpenCV DNN and SSD MobileNet v3.
17
+
18
+ ## 📌 Features
19
+
20
+ - Real-time webcam detection
21
+ - Pre-trained COCO model
22
+ - Non-Maximum Suppression (NMS)
23
+ - Easy-to-use ObjectDetector class
24
+
25
+ ## 📦 Installation
26
+
27
+ ```bash
28
+ pip install objectvision-naman
29
+
30
+ 🚀 Usage Example
31
+ import cv2
32
+ from objectvision_naman import ObjectDetector
33
+
34
+ detector = ObjectDetector()
35
+
36
+ cap = cv2.VideoCapture(0)
37
+
38
+ while True:
39
+ success, img = cap.read()
40
+ img = detector.detect(img)
41
+ cv2.imshow("Detection", img)
42
+
43
+ if cv2.waitKey(1) & 0xFF == ord('q'):
44
+ break
45
+
46
+ 🧠 Model Used
47
+ 💠SSD MobileNet v3
48
+ 💠COCO Dataset
49
+
50
+ 👨‍💻 Author
51
+ Naman Lohiya
@@ -0,0 +1,38 @@
1
+ # ObjectVision-Naman 🚀
2
+
3
+ Real-time Object Detection Library built using OpenCV DNN and SSD MobileNet v3.
4
+
5
+ ## 📌 Features
6
+
7
+ - Real-time webcam detection
8
+ - Pre-trained COCO model
9
+ - Non-Maximum Suppression (NMS)
10
+ - Easy-to-use ObjectDetector class
11
+
12
+ ## 📦 Installation
13
+
14
+ ```bash
15
+ pip install objectvision-naman
16
+
17
+ 🚀 Usage Example
18
+ import cv2
19
+ from objectvision_naman import ObjectDetector
20
+
21
+ detector = ObjectDetector()
22
+
23
+ cap = cv2.VideoCapture(0)
24
+
25
+ while True:
26
+ success, img = cap.read()
27
+ img = detector.detect(img)
28
+ cv2.imshow("Detection", img)
29
+
30
+ if cv2.waitKey(1) & 0xFF == ord('q'):
31
+ break
32
+
33
+ 🧠 Model Used
34
+ 💠SSD MobileNet v3
35
+ 💠COCO Dataset
36
+
37
+ 👨‍💻 Author
38
+ Naman Lohiya
@@ -0,0 +1,3 @@
1
+ from .detector import ObjectDetector
2
+
3
+ __all__ = ["ObjectDetector"]
@@ -0,0 +1,42 @@
1
+ import cv2
2
+ import numpy as np
3
+ from .model import load_model
4
+ from .utils import load_class_names
5
+
6
+ class ObjectDetector:
7
+ def __init__(self, threshold=0.65, nms_threshold=0.35):
8
+ self.threshold = threshold
9
+ self.nms_threshold = nms_threshold
10
+
11
+ self.net = load_model()
12
+ self.classNames = load_class_names()
13
+
14
+ def detect(self, img):
15
+ classIds, confs, bbox = self.net.detect(img, confThreshold=self.threshold)
16
+
17
+ if len(bbox) == 0:
18
+ return img
19
+
20
+ bbox = list(bbox)
21
+ confs = list(np.array(confs).reshape(1, -1)[0])
22
+ confs = list(map(float, confs))
23
+
24
+ indices = cv2.dnn.NMSBoxes(bbox, confs, self.threshold, self.nms_threshold)
25
+
26
+ for i in indices:
27
+ if len(indices.shape) > 1:
28
+ i = i[0]
29
+
30
+ box = bbox[i]
31
+ x, y, w, h = box
32
+ cv2.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2)
33
+
34
+ classId = classIds[i][0] if len(classIds[i].shape) > 0 else classIds[i]
35
+ cv2.putText(img,
36
+ self.classNames[classId - 1].upper(),
37
+ (x + 10, y + 30),
38
+ cv2.FONT_HERSHEY_COMPLEX,
39
+ 1,
40
+ (0, 255, 0),
41
+ 2)
42
+ return img
@@ -0,0 +1,22 @@
1
+ import cv2
2
+ import os
3
+
4
+ def load_model():
5
+ base_path = os.path.abspath(os.path.dirname(__file__))
6
+
7
+ weightsPath = os.path.join(base_path, "frozen_inference_graph.pb")
8
+ configPath = os.path.join(base_path, "ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt")
9
+
10
+ if not os.path.exists(weightsPath):
11
+ raise FileNotFoundError(f"Model file not found at {weightsPath}")
12
+
13
+ if not os.path.exists(configPath):
14
+ raise FileNotFoundError(f"Config file not found at {configPath}")
15
+
16
+ net = cv2.dnn_DetectionModel(weightsPath, configPath)
17
+ net.setInputSize(320, 320)
18
+ net.setInputScale(1.0 / 127.5)
19
+ net.setInputMean((127.5, 127.5, 127.5))
20
+ net.setInputSwapRB(True)
21
+
22
+ return net
@@ -0,0 +1,10 @@
1
+ import os
2
+
3
+ def load_class_names():
4
+ base_path = os.path.dirname(__file__)
5
+ classFile = os.path.join(base_path, "coco.names")
6
+
7
+ with open(classFile, 'rt') as f:
8
+ classNames = f.read().rstrip('\n').split('\n')
9
+
10
+ return classNames
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.4
2
+ Name: objectvisions
3
+ Version: 0.0.1
4
+ Summary: Real-time Object Detection using OpenCV DNN
5
+ Author-email: Naman Lohiya <your_email@gmail.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: opencv-python
11
+ Requires-Dist: numpy
12
+ Dynamic: license-file
13
+
14
+ # ObjectVision-Naman 🚀
15
+
16
+ Real-time Object Detection Library built using OpenCV DNN and SSD MobileNet v3.
17
+
18
+ ## 📌 Features
19
+
20
+ - Real-time webcam detection
21
+ - Pre-trained COCO model
22
+ - Non-Maximum Suppression (NMS)
23
+ - Easy-to-use ObjectDetector class
24
+
25
+ ## 📦 Installation
26
+
27
+ ```bash
28
+ pip install objectvision-naman
29
+
30
+ 🚀 Usage Example
31
+ import cv2
32
+ from objectvision_naman import ObjectDetector
33
+
34
+ detector = ObjectDetector()
35
+
36
+ cap = cv2.VideoCapture(0)
37
+
38
+ while True:
39
+ success, img = cap.read()
40
+ img = detector.detect(img)
41
+ cv2.imshow("Detection", img)
42
+
43
+ if cv2.waitKey(1) & 0xFF == ord('q'):
44
+ break
45
+
46
+ 🧠 Model Used
47
+ 💠SSD MobileNet v3
48
+ 💠COCO Dataset
49
+
50
+ 👨‍💻 Author
51
+ Naman Lohiya
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+ Readme.md
3
+ pyproject.toml
4
+ objectvisions/__init__.py
5
+ objectvisions/detector.py
6
+ objectvisions/model.py
7
+ objectvisions/utils.py
8
+ objectvisions.egg-info/PKG-INFO
9
+ objectvisions.egg-info/SOURCES.txt
10
+ objectvisions.egg-info/dependency_links.txt
11
+ objectvisions.egg-info/requires.txt
12
+ objectvisions.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ opencv-python
2
+ numpy
@@ -0,0 +1 @@
1
+ objectvisions
@@ -0,0 +1,21 @@
1
+ [build-system]
2
+ requires = ["setuptools>=70", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "objectvisions"
7
+ version = "0.0.1"
8
+ description = "Real-time Object Detection using OpenCV DNN"
9
+ readme = "Readme.md"
10
+ requires-python = ">=3.8"
11
+
12
+ authors = [
13
+ { name = "Naman Lohiya", email = "your_email@gmail.com" }
14
+ ]
15
+
16
+ license = "MIT"
17
+
18
+ dependencies = [
19
+ "opencv-python",
20
+ "numpy"
21
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+