Eeman Majumder commited on
Commit
3332248
1 Parent(s): 8613403
.DS_Store ADDED
Binary file (6.15 kB). View file
 
Dockerfile ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ RUN apt-get update
2
+ RUN apt-get install ffmpeg libsm6 libxext6 -y
Images/seesh.png CHANGED
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Eeman Majumder
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.
app.py CHANGED
@@ -1,12 +1,21 @@
 
 
1
  import streamlit as st
2
  import os
3
  import subprocess
4
  import geocoder
5
  import pandas as pd
6
  from csv import writer
 
 
 
7
  # import keyboard
8
  # st.title('Dawg Detection 🐶')
9
  st.markdown("<h1 style='text-align: center; color: white;'>Dawg Detection 🐶</h1>", unsafe_allow_html=True)
 
 
 
 
10
  jury=True
11
  if 'jury' not in st.session_state:
12
  st.session_state.jury = False
@@ -14,8 +23,14 @@ if 'jury' not in st.session_state:
14
  butt=st.button('Configure',disabled=st.session_state.jury,help='Press This And Wait A Few Seconds If You Are Running The Website For The First Time')
15
  if butt==True:
16
  os.system('git clone https://github.com/WongKinYiu/yolov7')
17
- os.system('%cd yolov7')
18
- os.system('pip install -r requirements.txt')
 
 
 
 
 
 
19
  os.system('ls')
20
  os.system('wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt')
21
  os.system('pip install opencv_python')
@@ -24,20 +39,32 @@ if butt==True:
24
  os.system('pip install scipy')
25
  st.session_state.jury = True
26
 
 
27
 
 
28
  bob='python yolov7/detect.py --weights yolov7.pt --classes 16 --conf 0.25 --img-size 640 --source Images/seesh.png --exist-ok --save-conf --save-txt'
29
- tusk='python yolov7/detect.py --weights yolov7.pt --classes 16 --conf 0.25 --img-size 640 --source Images/seesh.png --exist-ok --save-conf --save-txt'
 
30
 
 
31
 
 
32
  pic=st.camera_input('Take A Picture')
33
  if pic:
34
  with open ('Images/seesh.png','wb') as file:
35
  file.write(pic.getbuffer())
36
- os.system(bob)
 
 
 
 
37
  st.text('Detected Dawgs')
38
- img=st.image('runs/detect/exp/seesh.png')
 
39
 
40
- #count
 
 
41
  f=open("runs/detect/exp/labels/seesh.txt",'r')
42
  a=f.readlines()
43
  b=[]
@@ -46,15 +73,17 @@ if pic:
46
  b.append('yass')
47
  else:
48
  continue
49
- print(len(b))
50
  f=open("runs/detect/exp/labels/seesh.txt",'w')
51
  st.balloons()
52
- st.success(f'Total Number Of Dogs Detected: {len(b)}')
53
  st.markdown("---")
54
 
 
 
55
  #map
56
  g = geocoder.ip('me')
57
- print(g.latlng)
58
  with open('database/cord.csv', 'a') as f_object:
59
  writer_object = writer(f_object)
60
  writer_object.writerow(g.latlng)
@@ -62,10 +91,13 @@ if pic:
62
  df=pd.read_csv('database/cord.csv')
63
  cum=len(df['lat'])
64
  st.text(f'Your Location Coordinates: {g.latlng}')
65
- st.map(df,use_container_width=True,zoom = 4)
66
  st.markdown(f"<h5 style='color: red;'>Total Number Of Reports Around The World: {cum}<h5>", unsafe_allow_html=True)
67
 
68
- clicked= st.button('Click Me For Balloons',help='Click here to feel happy 😁')
 
 
69
  if clicked==True:
70
  st.balloons()
71
 
 
 
1
+ #________________________________________________________________________________________________________________________
2
+ #installing esential requirements
3
  import streamlit as st
4
  import os
5
  import subprocess
6
  import geocoder
7
  import pandas as pd
8
  from csv import writer
9
+
10
+
11
+ #________________________________________________________________________________________________________________________
12
  # import keyboard
13
  # st.title('Dawg Detection 🐶')
14
  st.markdown("<h1 style='text-align: center; color: white;'>Dawg Detection 🐶</h1>", unsafe_allow_html=True)
15
+
16
+ #________________________________________________________________________________________________________________________
17
+
18
+ #setting up the cofigure button
19
  jury=True
20
  if 'jury' not in st.session_state:
21
  st.session_state.jury = False
 
23
  butt=st.button('Configure',disabled=st.session_state.jury,help='Press This And Wait A Few Seconds If You Are Running The Website For The First Time')
24
  if butt==True:
25
  os.system('git clone https://github.com/WongKinYiu/yolov7')
26
+ # os.system('%cd yolov7')
27
+ # os.system('pip install -r requirements.txt')
28
+ # os.system('pip install -r yolov7/requirements.txt')
29
+
30
+
31
+ #________________________________________________________________________________________________________________________
32
+
33
+ #making essential installs using zhc com mands
34
  os.system('ls')
35
  os.system('wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt')
36
  os.system('pip install opencv_python')
 
39
  os.system('pip install scipy')
40
  st.session_state.jury = True
41
 
42
+ #________________________________________________________________________________________________________________________
43
 
44
+ #bob represents the AI command
45
  bob='python yolov7/detect.py --weights yolov7.pt --classes 16 --conf 0.25 --img-size 640 --source Images/seesh.png --exist-ok --save-conf --save-txt'
46
+ # tusk='python /yolov7/detect.py --weights /yolov7.pt --classes 16 --conf 0.25 --img-size 640 --source /Images/seesh.png --exist-ok --save-conf --save-txt'
47
+
48
 
49
+ #________________________________________________________________________________________________________________________
50
 
51
+ #getting camera input
52
  pic=st.camera_input('Take A Picture')
53
  if pic:
54
  with open ('Images/seesh.png','wb') as file:
55
  file.write(pic.getbuffer())
56
+ # os.system('apt-get update')
57
+ # os.system('apt-get install ffmpeg libsm6 libxext6 -y')
58
+ # os.system('pip install opencv-python')
59
+
60
+ os.system(bob)#detecting the dogsss
61
  st.text('Detected Dawgs')
62
+ img=st.image('runs/detect/exp/seesh.png')# showing the detcted image
63
+ # print('issue1')
64
 
65
+ #________________________________________________________________________________________________________________________
66
+
67
+ #counting the number of dawgs
68
  f=open("runs/detect/exp/labels/seesh.txt",'r')
69
  a=f.readlines()
70
  b=[]
 
73
  b.append('yass')
74
  else:
75
  continue
76
+ print(len(b))#printing the number of dogs
77
  f=open("runs/detect/exp/labels/seesh.txt",'w')
78
  st.balloons()
79
+ st.success(f'Total Number Of Dogs Detected: {len(b)}')#printing the number of dogs
80
  st.markdown("---")
81
 
82
+ #________________________________________________________________________________________________________________________
83
+
84
  #map
85
  g = geocoder.ip('me')
86
+ print(g.latlng)#fetching the cords
87
  with open('database/cord.csv', 'a') as f_object:
88
  writer_object = writer(f_object)
89
  writer_object.writerow(g.latlng)
 
91
  df=pd.read_csv('database/cord.csv')
92
  cum=len(df['lat'])
93
  st.text(f'Your Location Coordinates: {g.latlng}')
94
+ st.map(df,use_container_width=True,zoom = 4)#plotting the cords in map
95
  st.markdown(f"<h5 style='color: red;'>Total Number Of Reports Around The World: {cum}<h5>", unsafe_allow_html=True)
96
 
97
+ #________________________________________________________________________________________________________________________
98
+
99
+ clicked= st.button('Click Me For Balloons',help='Click here to feel happy 😁')#adding the baroon button
100
  if clicked==True:
101
  st.balloons()
102
 
103
+ #________________________________________________________________________________________________________________________
database/cord.csv CHANGED
@@ -1,49 +1,49 @@
1
  lat,lon
2
  23.1172,76.8815
3
- 23.1172,76.8815
4
- 19.0728,72.8826
5
- 23.1172,76.8815
6
- 23.1172,76.8815
7
- 23.1172,76.8815
8
- 23.1172,76.8815
9
- 19.0728,72.8826
10
- 19.0728,72.8826
11
- 23.1172,76.8815
12
- 23.1172,76.8815
13
- 19.0728,72.8826
14
- 23.1172,76.8815
15
- 23.1172,76.8815
16
- 19.0728,72.8826
17
- 23.1172,76.8815
18
- 19.0728,72.8826
19
- 19.0728,72.8826
20
- 23.1172,76.8815
21
- 19.0728,72.8826
22
- 23.1172,76.8815
23
- 19.0728,72.8826
24
- 23.1172,76.8815
25
- 23.1172,76.8815
26
- 23.1172,76.8815
27
- 19.0728,72.8826
28
- 19.0728,72.8826
29
- 23.1172,76.8815
30
- 19.0728,72.8826
31
- 19.0728,72.8826
32
- 19.0728,72.8826
33
- 23.1172,76.8815
34
- 23.1172,76.8815
35
- 19.0728,72.8826
36
- 19.0728,72.8826
37
- 19.0728,72.8826
38
- 23.1172,76.8815
39
- 23.1172,76.8815
40
- 23.1172,76.8815
41
- 19.0728,72.8826
42
- 23.1172,76.8815
43
- 23.1172,76.8815
44
- 23.1172,76.8815
45
- 23.1172,76.8815
46
- 19.0728,72.8826
47
- 19.0728,72.8826
48
- 19.0728,72.8826
49
- 19.0728,72.8826
 
1
  lat,lon
2
  23.1172,76.8815
3
+ 23.1172,76.8815
4
+ 19.0728,72.8826
5
+ 23.1172,76.8815
6
+ 23.1172,76.8815
7
+ 23.1172,76.8815
8
+ 23.1172,76.8815
9
+ 19.0728,72.8826
10
+ 19.0728,72.8826
11
+ 23.1172,76.8815
12
+ 23.1172,76.8815
13
+ 19.0728,72.8826
14
+ 23.1172,76.8815
15
+ 23.1172,76.8815
16
+ 19.0728,72.8826
17
+ 23.1172,76.8815
18
+ 19.0728,72.8826
19
+ 19.0728,72.8826
20
+ 23.1172,76.8815
21
+ 19.0728,72.8826
22
+ 23.1172,76.8815
23
+ 19.0728,72.8826
24
+ 23.1172,76.8815
25
+ 23.1172,76.8815
26
+ 23.1172,76.8815
27
+ 19.0728,72.8826
28
+ 19.0728,72.8826
29
+ 23.1172,76.8815
30
+ 19.0728,72.8826
31
+ 19.0728,72.8826
32
+ 19.0728,72.8826
33
+ 23.1172,76.8815
34
+ 23.1172,76.8815
35
+ 19.0728,72.8826
36
+ 19.0728,72.8826
37
+ 19.0728,72.8826
38
+ 23.1172,76.8815
39
+ 23.1172,76.8815
40
+ 23.1172,76.8815
41
+ 19.0728,72.8826
42
+ 23.1172,76.8815
43
+ 23.1172,76.8815
44
+ 23.1172,76.8815
45
+ 23.1172,76.8815
46
+ 19.0728,72.8826
47
+ 19.0728,72.8826
48
+ 19.0728,72.8826
49
+ 19.0728,72.8826
packages.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ python3-opencv
requirements.txt CHANGED
@@ -1,3 +1,43 @@
1
  geocoder==1.38.1
2
  pandas==1.5.0
3
  streamlit==1.13.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  geocoder==1.38.1
2
  pandas==1.5.0
3
  streamlit==1.13.0
4
+ # Usage: pip install -r requirements.txt
5
+
6
+ # Base ----------------------------------------
7
+ matplotlib>=3.2.2
8
+ numpy>=1.18.5
9
+ opencv-python>=4.1.1
10
+ Pillow>=7.1.2
11
+ PyYAML>=5.3.1
12
+ requests>=2.23.0
13
+ scipy>=1.4.1
14
+ torch>=1.7.0,!=1.12.0
15
+ torchvision>=0.8.1,!=0.13.0
16
+ tqdm>=4.41.0
17
+ protobuf<4.21.3
18
+
19
+ # Logging -------------------------------------
20
+ tensorboard>=2.4.1
21
+ # wandb
22
+
23
+ # Plotting ------------------------------------
24
+ pandas>=1.1.4
25
+ seaborn>=0.11.0
26
+
27
+ # Export --------------------------------------
28
+ # coremltools>=4.1 # CoreML export
29
+ # onnx>=1.9.0 # ONNX export
30
+ # onnx-simplifier>=0.3.6 # ONNX simplifier
31
+ # scikit-learn==0.19.2 # CoreML quantization
32
+ # tensorflow>=2.4.1 # TFLite export
33
+ # tensorflowjs>=3.9.0 # TF.js export
34
+ # openvino-dev # OpenVINO export
35
+
36
+ # Extras --------------------------------------
37
+ ipython # interactive notebook
38
+ psutil # system utilization
39
+ thop # FLOPs computation
40
+ # albumentations>=1.0.3
41
+ # pycocotools>=2.0 # COCO mAP
42
+ # roboflow
43
+
runs/.DS_Store ADDED
Binary file (6.15 kB). View file
 
runs/detect/.DS_Store ADDED
Binary file (6.15 kB). View file
 
runs/detect/exp/.DS_Store ADDED
Binary file (6.15 kB). View file
 
runs/detect/exp/seesh.png ADDED