0
@app.route('/add')

def add():
    return render_template('add.html')

def gen(camera):
    while True:
        label, frame = camera.get_frame()
        if label=="unknown":
            print("Inside If condition")
            with app.app_context():
                add()

why can't we call the function in this way? Using add(), I want to redirect to some another template when an unknown face detected in the video streaming.

sodmzs
  • 184
  • 1
  • 16
  • What do you mean by "we can't call the function this way?" Are you getting an error message? Should `app()` here actually be `add()`? What do you expect to happen, and what's happening instead? Please read [ask]. – ChrisGPT was on strike Dec 24 '19 at 15:54
  • Okay, so please [edit] your question and fix the typo. What about the rest of my questions? Most importantly, what do you expect this code to _do_? It looks like maybe you're trying to manually stream frames from a video? – ChrisGPT was on strike Dec 24 '19 at 16:01
  • I want to redirect to some another template when an unknown face detected in the video stream. – sodmzs Dec 24 '19 at 16:12
  • 1
    Does this answer your question? [Internal Redirect in Flask](https://stackoverflow.com/questions/32534051/internal-redirect-in-flask) – Happy-Monad Dec 24 '19 at 16:43
  • I simply want to redirect to the another template while on video streaming if an unknown object of named ' unknown ' is detected in the video streaming. Please help me using the above code – sodmzs Dec 25 '19 at 03:34
  • @sodmzs, that's what Happy-Monad is trying to do. Did you read the duplicate they suggested? – ChrisGPT was on strike Dec 25 '19 at 13:22

0 Answers0