cfn/iot.yaml [599:617]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              print("running inference loop")
              test_file = random.choice(test_files)
              print("Running inference on {0}".format(test_file))
              fname = os.path.split(test_file)[1]
              imgid = os.path.splitext(fname)[0] + '_' + str(int(time.time()))

              imgpayload = {}
              imgpayload['imgid'] = imgid 
              imgpayload['timestamp'] = str(int(time.time()))
              imgpayload['fab'] = fabid
              imgpayload['camera'] = cameraid
              print("Payload before image bytes: " + json.dumps(imgpayload))

              with open(test_file, "rb") as imageFile:
                  imgpayload['bytes'] = base64.b64encode(imageFile.read())
                  print(imgpayload['bytes'])

              topicPath="fabwafer/{0}/{1}/img/{2}".format(fabid, cameraid, imgid)
              print("Publishing to topic " + topicPath)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



lambda-rpi-inference/greengrassObjectClassification.py [76:95]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    print("running inference loop")

    test_file = random.choice(test_files)
    print("Running inference on {0}".format(test_file))
    fname = os.path.split(test_file)[1]
    imgid = os.path.splitext(fname)[0] + '_' + str(int(time.time()))

    imgpayload = {}
    imgpayload['imgid'] = imgid 
    imgpayload['timestamp'] = str(int(time.time()))
    imgpayload['fab'] = fabid
    imgpayload['camera'] = cameraid
    print("Payload before image bytes: " + json.dumps(imgpayload))

    with open(test_file, "rb") as imageFile:
        imgpayload['bytes'] = base64.b64encode(imageFile.read())
        print(imgpayload['bytes'])

    topicPath="fabwafer/{0}/{1}/img/{2}".format(fabid, cameraid, imgid)
    print("Publishing to topic " + topicPath)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



