Vivien Chappelier commited on
Commit
fd7b2b7
β€’
1 Parent(s): 8798e5f

restore basic auth

Browse files
Files changed (1) hide show
  1. detect_api.py +2 -0
detect_api.py CHANGED
@@ -6,7 +6,9 @@ def detect_api(filename):
6
  b64 = base64.b64encode(open(sys.argv[1], 'rb').read()).decode('utf8')
7
  data = dict(image = b64)
8
  response = requests.post('https://bzh.imatag.com/bzh/api/v1.0/detect',
 
9
  json=data)
 
10
  if response.json()['p-value'] < 1e-3:
11
  print("watermark detected")
12
  else:
 
6
  b64 = base64.b64encode(open(sys.argv[1], 'rb').read()).decode('utf8')
7
  data = dict(image = b64)
8
  response = requests.post('https://bzh.imatag.com/bzh/api/v1.0/detect',
9
+ headers={'X-Api-Key': 'e80069e02b767fdca459c42fcc5577ab'},
10
  json=data)
11
+ response.raise_for_status()
12
  if response.json()['p-value'] < 1e-3:
13
  print("watermark detected")
14
  else: