Spaces:
Running
Running
Commit
·
205fb4e
1
Parent(s):
61d4fcb
updates
Browse files
vouchervision/OCR_google_cloud_vision.py
CHANGED
|
@@ -810,7 +810,7 @@ class SafetyCheck():
|
|
| 810 |
return credentials
|
| 811 |
|
| 812 |
def check_for_inappropriate_content(self, file_stream):
|
| 813 |
-
LEVEL =
|
| 814 |
content = file_stream.read()
|
| 815 |
image = vision.Image(content=content)
|
| 816 |
response = self.client.safe_search_detection(image=image)
|
|
@@ -835,9 +835,10 @@ class SafetyCheck():
|
|
| 835 |
# Check the levels of adult, violence, racy, etc. content.
|
| 836 |
if (safe.adult > LEVEL or
|
| 837 |
safe.medical > LEVEL or
|
| 838 |
-
safe.spoof > LEVEL or
|
| 839 |
-
safe.violence > LEVEL or
|
| 840 |
-
safe.racy > LEVEL
|
|
|
|
| 841 |
print("Found violation")
|
| 842 |
return True # The image violates safe search guidelines.
|
| 843 |
|
|
|
|
| 810 |
return credentials
|
| 811 |
|
| 812 |
def check_for_inappropriate_content(self, file_stream):
|
| 813 |
+
LEVEL = 3
|
| 814 |
content = file_stream.read()
|
| 815 |
image = vision.Image(content=content)
|
| 816 |
response = self.client.safe_search_detection(image=image)
|
|
|
|
| 835 |
# Check the levels of adult, violence, racy, etc. content.
|
| 836 |
if (safe.adult > LEVEL or
|
| 837 |
safe.medical > LEVEL or
|
| 838 |
+
# safe.spoof > LEVEL or
|
| 839 |
+
safe.violence > LEVEL #or
|
| 840 |
+
# safe.racy > LEVEL
|
| 841 |
+
):
|
| 842 |
print("Found violation")
|
| 843 |
return True # The image violates safe search guidelines.
|
| 844 |
|