shivam-kala commited on
Commit
3c94c2f
·
1 Parent(s): df0214a

removed cv2

Browse files
Files changed (2) hide show
  1. requirements.txt +0 -4
  2. scraper/__init__.py +2 -2
requirements.txt CHANGED
@@ -1,4 +1,3 @@
1
-
2
  numpy
3
  Django==5.0.2
4
  python-dotenv==1.0.1
@@ -7,9 +6,6 @@ schedule==1.2.1
7
  django-allauth==0.61.1
8
  fake_useragent
9
  django-cors-headers
10
- # opencv-python
11
- opencv_python==4.9.0.80
12
-
13
  pillow
14
  # psycopg2
15
  psycopg2-binary
 
 
1
  numpy
2
  Django==5.0.2
3
  python-dotenv==1.0.1
 
6
  django-allauth==0.61.1
7
  fake_useragent
8
  django-cors-headers
 
 
 
9
  pillow
10
  # psycopg2
11
  psycopg2-binary
scraper/__init__.py CHANGED
@@ -6,7 +6,6 @@ from datetime import datetime
6
  from bs4 import BeautifulSoup
7
  import base64, io, numpy as np
8
  from PIL import Image
9
- import cv2
10
 
11
  ua = UserAgent(platforms="pc")
12
 
@@ -53,7 +52,8 @@ class BaseScrapper(ABC):
53
  img_path = log_dir/Path(f"{cur_time.day}-{cur_time.month}-{cur_time.year}--{cur_time.hour}-{cur_time.minute}-{cur_time.second}.png")
54
  bytes_array = io.BytesIO(base64.b64decode(self.base64))
55
  image = np.array(Image.open(bytes_array).convert("RGB"))
56
- cv2.imwrite(str(img_path),image[:,:,::-1])
 
57
 
58
 
59
  @classmethod
 
6
  from bs4 import BeautifulSoup
7
  import base64, io, numpy as np
8
  from PIL import Image
 
9
 
10
  ua = UserAgent(platforms="pc")
11
 
 
52
  img_path = log_dir/Path(f"{cur_time.day}-{cur_time.month}-{cur_time.year}--{cur_time.hour}-{cur_time.minute}-{cur_time.second}.png")
53
  bytes_array = io.BytesIO(base64.b64decode(self.base64))
54
  image = np.array(Image.open(bytes_array).convert("RGB"))
55
+ Image.fromarray(image).save(img_path)
56
+
57
 
58
 
59
  @classmethod