weihongliang commited on
Commit
708505f
·
verified ·
1 Parent(s): 8d4b5ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -15
app.py CHANGED
@@ -133,8 +133,8 @@ def fetch_wikipedia_info(url):
133
  def recognize_celebrities(image_path, confidence_threshold=90):
134
  client = boto3.client(
135
  "rekognition",
136
- aws_access_key_id=,
137
- aws_secret_access_key=,
138
  region_name='us-east-1'
139
  )
140
 
@@ -401,19 +401,6 @@ def create_interface():
401
  {'Width': 0.07422236353158951, 'Height': 0.15943190455436707, 'Left': 0.4633428454399109, 'Top': 0.07901764661073685},
402
  {'Width': 0.07562466710805893, 'Height': 0.13936467468738556, 'Left': 0.025178398936986923, 'Top': 0.4953641891479492}],
403
  ['https://www.wikidata.org/wiki/Q3572699', 'https://www.wikidata.org/wiki/Q92894', 'https://www.wikidata.org/wiki/Q3571662']],
404
- ["./clinton.jpg", "Who are the people in the picture, and what is the relationship between them?",
405
- ['Bill Clinton', 'Monica Lewinsky'],
406
- [{'Width': 0.07620880007743835, 'Height': 0.16198107600212097, 'Left': 0.5074607729911804, 'Top': 0.14220821857452393},
407
- {'Width': 0.0722670778632164, 'Height': 0.1512720286846161, 'Left': 0.3914872407913208, 'Top': 0.24376636743545532}],
408
- ['https://www.wikidata.org/wiki/Q1124', 'https://www.wikidata.org/wiki/Q212659']],
409
- ["./epst.jpeg", "Provide image description.",
410
- ['Lisa Randall', 'Kip S. Thorne', 'David Gross', 'Stephen Hawking', 'Brenda Chapman'],
411
- [{'Width': 0.09916354715824127, 'Height': 0.166521355509758, 'Left': 0.7962431311607361, 'Top': 0.4121580123901367},
412
- {'Width': 0.07940348237752914, 'Height': 0.1626593917608261, 'Left': 0.6891748905181885, 'Top': 0.33117005228996277},
413
- {'Width': 0.06350294500589371, 'Height': 0.12757645547389984, 'Left': 0.544218122959137, 'Top': 0.1575603038072586},
414
- {'Width': 0.06830617040395737, 'Height': 0.1128319799900055, 'Left': 0.2937725782394409, 'Top': 0.30404558777809143},
415
- {'Width': 0.03966952860355377, 'Height': 0.11658532917499542, 'Left': 0.18093101680278778, 'Top': 0.31299835443496704}],
416
- ['https://www.wikidata.org/wiki/Q450404', 'https://www.wikidata.org/wiki/Q323320', 'https://www.wikidata.org/wiki/Q40262', 'https://www.wikidata.org/wiki/Q17714', 'https://www.wikidata.org/wiki/Q429715']]
417
  ]
418
 
419
  # Filter examples to only include files that exist
 
133
  def recognize_celebrities(image_path, confidence_threshold=90):
134
  client = boto3.client(
135
  "rekognition",
136
+ aws_access_key_id=os.getenv('aws_access_key_id'),
137
+ aws_secret_access_key=os.getenv('aws_secret_access_key'),
138
  region_name='us-east-1'
139
  )
140
 
 
401
  {'Width': 0.07422236353158951, 'Height': 0.15943190455436707, 'Left': 0.4633428454399109, 'Top': 0.07901764661073685},
402
  {'Width': 0.07562466710805893, 'Height': 0.13936467468738556, 'Left': 0.025178398936986923, 'Top': 0.4953641891479492}],
403
  ['https://www.wikidata.org/wiki/Q3572699', 'https://www.wikidata.org/wiki/Q92894', 'https://www.wikidata.org/wiki/Q3571662']],
 
 
 
 
 
 
 
 
 
 
 
 
 
404
  ]
405
 
406
  # Filter examples to only include files that exist