r/StackoverReddit • • Jun 11 '25

Java Is it OK to override a base class method in a trait?

3 Upvotes

I have a parent class and two child class, the two child classes have two overriden methods but both of them are same in the two child classes. Is it right to extract out these protected overriden methods as is to a common trait which contains other utils being used in the two classes as well.

1. If the overridden methods are completely identical in both child classes and you want to enforce a single source of truth, moving the override into a trait is correct.

2. Confusing and code smell

WDYT?


r/StackoverReddit • • Sep 05 '24

Question Is web development still worth learning in 2024

3 Upvotes

r/StackoverReddit • • Aug 22 '24

Question What skills to learn other than Web/Android/Ios Development, Machine Learning for Jobs and Interships?

3 Upvotes

I want to know what are some skills in which I can do internships other than the usual development and ML.


r/StackoverReddit • • Aug 06 '24

Question A Facebook app that isn't an "app"?

3 Upvotes

I have to get basic data from Facebook Pages (as opposed to Profiles) e.g. https://www.facebook.com/njordgearshop

This getting of basic data is going to be part of a larger workflow that will run on one of our servers. There's not going to be an Android or iOS app in that sense.

We've create a Meta App, and have connected it to a verified Business portfolio.

We want to be able to access the public Pages of community organisations and politicians. We appear to need an access_token for that, thus the creation of Meta App so that we have the app_id and app_secret from which to generate an App Token.

However, when we issue that App Token in a search for say, roeburneraces in the Graph API Explorer with pages/search?q=roeburneraces&fields=id,name,location,link we get

{
  "error": {
    "message": "(#10) This endpoint requires the 'pages_read_engagement' permission or the 'Page Public Content Access' feature or the 'Page Public Metadata Access' feature. Refer to https://developers.facebook.com/docs/apps/review/login-permissions#manage-pages, https://developers.facebook.com/docs/apps/review/feature#reference-PAGES_ACCESS and https://developers.facebook.com/docs/apps/review/feature#page-public-metadata-access for details.",
    "type": "OAuthException",
    "code": 10,
    "fbtrace_id": "ANvRkSrF3kqHRQaw1OnYKIq"
  }
}

So how do you add pages_read_engagement to an "App Token"? You can't. So where to from here?

Somehow we have to be able to build a full-length access_token. A User Token is useless because we're interested in Pages not Users. And generating a Page Access token that targets the aforementioned Business portfolio proves equally useless and when logged in as the Business portfolio one only has a limited set of possible Page Access tokens to choose from.

If I'm reading the documentation correctly, the 'Page Public Content Access' and 'Page Public Metadata Access' features are only available after App Review. I'm bound to fail App Review because I can't demonstrate what I need a pass in App Review to demonstrate.

I really hope I'm missing something obvious.


r/StackoverReddit • • Aug 05 '24

Question Your post has been marked as duplicate

3 Upvotes

"Please edit your question to be more clear"

"This question is not on topic"

"Your question has been closed because it didn't meet the requirements of a good question"

"I don't understand why you'd do things like that. Method B is much easier"

Surely we're not gonna get those type of shit in this sub right? Almost every question I ask on stackexchange has comments complaining about the question itself instead of answering it.


r/StackoverReddit • • Aug 03 '24

Python Getting "websockets.exceptions.ConnectionClosedOK: sent 1000 (OK); then received 1000 (OK)" error Character AI

3 Upvotes

Heya Developers!

I am currently making a Discord.py bot which uses Character AI's api to basically talk to any character in the character ai database (in our case Hatsune Miku). I got the bot to startup but when i send a message to the bot, this error pops up

Traceback (most recent call last):
  File "C:\Users\[redacted]\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\client.py", line 449, in _run_event
    await coro(*args, **kwargs)
  File "c:\[redacted]\Python-Projects\Aviationbot copy\mian.py", line 159, in on_message
    response = await chat.send_message(char, chat_id, text)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\[redacted]\AppData\Local\Programs\Python\Python312\Lib\site-packages\characterai\aiocai\methods\chat2.py", line 360, in send_message
    await self.ws.send(json.dumps(message))
  File "C:\Users\[redacted]\AppData\Local\Programs\Python\Python312\Lib\site-packages\websockets\legacy\protocol.py", line 635, in send
    await self.ensure_open()
  File "C:\Users\[redacted]\AppData\Local\Programs\Python\Python312\Lib\site-packages\websockets\legacy\protocol.py", line 944, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedOK: sent 1000 (OK); then received 1000 (OK)

How do i fix it?


r/StackoverReddit • • Aug 01 '24

Kubernetes Oracle Database Operator for Kubernetes

3 Upvotes

Hello,

Im following thing tutorial https://github.com/oracle/oracle-database-operator?tab=readme-ov-file to install ODB Operator for Kubernetes and already ran in to some problems. I'm new to Kubernetes so I really have no idea what I'm doing wrong here :D

Thanks for your time in advance!

______________________________________________

Problem:

  • Install cert-manager - this step went fine all good.

  • Create Role Bindings for Access Management

    1. Cluster Scoped Deployment

I chose this Cluster Scoped Deployment because it says that its default and after running the command
kubectl apply -f rbac/cluster-role-binding.yaml
and I'm getting error:

Im guessing I have to create this file in rbac path but I dont know how and if its the right way to fix this problem ?


r/StackoverReddit • • Jul 31 '24

Javascript Help me build a i18n localization framework

3 Upvotes

I’m building a Next.js internationalization (i18n) framework that can do all the following:

  • Text translations with pluralization and interpolation (string injection) support.

    • Using the original string as the key for better readability. ix("hello world")

  • Automatic translation management (JSON translation files) and extraction

    • We create a translate script that extracts content and generates JSON translation templates whenever you add or change text in ix() . No need to manually manage translations anymore.

  • Localized routing system. Example, going to /fr/about will take you to /about and set the locale to French. This makes localization SEO friendly

  • Continuous translation service. Your JSON translation is synchronized with us. We continuously translate for you so you can focus on development.

    • Human translators offer better context-based translations

  • Very intuitive framework, designed by product engineers. We keep the framework as simple and non-invasive to your codebase. You should be able to set up the framework in minutes.

What else would you like in a translation framework? What would you like to see in a translation framework that other frameworks don’t have?


r/StackoverReddit • • Jul 31 '24

Python Need some recommendation to test web pages that has canvas

3 Upvotes

Hello y'all soo I do automation testing with robot framework/python, and I'm working on a project that uses maps like the one found in Google maps, these elements are stored in html canvas where java script is used to trace geometry on them. Soo the problem is that I use selenium for my tests but the content of the maps is stored inside the canvas which mean they don't appear in the Dom html source code so selenium can't interact with them

If anyone has any recommendations on how to test elements that are stored inside canvas, thank in advance


r/StackoverReddit • • Jul 31 '24

C# Let's Learn It! Akka Dotnet Livestream (8/1/24 @ 7pm CST)

3 Upvotes

Hey y'all! I'm wanting to spread the word on actor systems and akka dotnet, so I'm going to be building an actor system live on Youtube Aug. 1 2024 at 7pm CST. The use case is to create an actor model that mimics the flow of a restaurant.

https://www.youtube.com/watch?v=aWlnnt3aweg

Come and join me as we learn what an actor model is, how to use akka dotnet, and come with whatever questions you have. See you then!

For more details and to get a jump start, visit my github project

https://github.com/briansain/Akka.Restaurant


r/StackoverReddit • • Jul 29 '24

Question Wordpress Website is Displaying Instead of Google-Built Website Despite Change in CNAME

Thumbnail
self.webdev
3 Upvotes

r/StackoverReddit • • Jul 29 '24

Question pip not working

3 Upvotes

I am using python 3.12.4 on macOS, and am typing in on the first line "pip.install (fastf1)" if I don't type it like that (excluding the speech marks) I get a syntax error, but now I am getting a name error, where pip isn't defined, people have talked about command lines and virtual environments but I have no idea on how I should be typing this out, any help would be greatly appreciated.


r/StackoverReddit • • Jul 29 '24

Question Problem moving bugfix on master (release flow/git flow mixed branching strategy)

3 Upvotes

I had small problem with git flow and I'm trying to find right solution for it. I tried to show situation with image I attached.

So...

Master had some bug, feature 1 had small bug, witch already was deployed to production.

Developer 1 was already working on it.

At this time developer 2 was completing PR and moved his commits to master.

Developer 1 finished fix, merged his bugfix branch to release/9.2 branch then master branch. Then released fixed version to prod from branch/9.2 (with updated tag 9.2.1) (at this time feature 2 was merged to master, but it is not deployed at prod yet)

At this moment production is fixed and works fine.

Now Developer 2 wants to move his "feature 2" on production. he sees some commits after his feature but he does not minds it (thinks it is other feature), and creates new release/9.3 from 026b8ef9 his last commit, and deploys it. So he is redeployed feature 1 without fix.

What went wrong? For me developer 2 did right, he dont wanted to take unfamiliar (changes from other team) changes to production He did not know it was bugfix. But he could prevent it. Unfortunately only branch is named "bugfix" and commit messages do not include any indicator that it fixes something. (And also tag 9.2.1 does not show on master branch)

Is there some good solution for this kind of problems? Or is it better to change git flow to more robust one?


r/StackoverReddit • • Jul 25 '24

Question GraphQL Learning Resources - Videos/Courses

3 Upvotes

I have a good opportunity at my hand and I need to explore transitioning our REST API architecture to using GraphQL. What I'm looking for is some solid resources to learn graphql with hands on experience with a course. I'm not looking for docs as I do not have enough time to cover that. I'm a videos/courses guy, so would prefer if anyone has good recommendations that I can follow. I'm willing to put in extra hours to learn what it takes to make this possible, but would love it if I can find good understanding through courses. Or if anyone thinks this entire approach is a moot, I'm open for suggestions as well.


r/StackoverReddit • • Jul 25 '24

Python Making a simple text and button based game to learn Python and tkntr and trying to figure out how to approach a problem

3 Upvotes

I'm making game with a very simple GUI consisting of text and buttons you press to perform actions to teach myself python and tkntr. My biggest hurdle, however, is figuring out how to update the buttons in the game. My goal is to have the buttons act similar to commands you would type in a text based adventure game, but instead of having to guess what to type, you have all the options for each area presented on buttons (I plan to challenge myself to also add combat too later on). I know there may be other ways to approach it besides using buttons, but for the sake of education I want to do the button approach. What's a streamlined and effective way I can have the buttons and their actions update depending on the situation or location you are currently in?

Also, what would be a good way to handle moving between areas in that regard (moving between areas would mostly just change what text is shown and what actions you can perform)

Once I get over this hurdle, everything else will be much easier as I have a good idea on how to approach the other stuff, I just have very limited experience with GUI elements and even less with tkntr.


r/StackoverReddit • • Jul 25 '24

C++ Preparing for Codexpress: Last-Minute C++ Tips and Resources

3 Upvotes

Hey everyone, I'm gearing up for a Codexpress competition in C++ that's happening in just two days at our college, and I'm feeling a bit anxious since my knowledge of data structures and algorithms (DSA) is quite limited. I've got the basics of C++ down, but I'm looking for advice on what key topics and practice problems I should focus on to maximize my chances of performing well.

Any suggestions for last-minute study topics or specific types of questions that commonly appear in such competitions would be greatly appreciated! Also, if you have any favorite resources or practice sites for brushing up on DSA quickly, please share. Thanks in advance for your help!


r/StackoverReddit • • Jul 24 '24

Question Retryable write with txnNumber 4 is prohibited on session | Django and MongoDB

3 Upvotes

I have been assigned to do atomic update in below code.

I am not sure how to do for following line of code:

self._large_results.replace(json_result, encoding='utf-8', content_type='application/json')

Application Code

class MyWrapper(EmbeddedDocument):

# Set the maximum size to 12 MB

MAXIMUM_MONGO_DOCUMENT_SIZE = 12582912

# Lock object to lock while updating the _large_result

lock = threading.Lock()

# The default location to save results

results = DictField()

# When the results are very large (> 16M mongo will not save it in

# a single document. We will use a file field to store these)

_large_results = FileField(required=True)

def large_results(self):

try:

self._large_results.seek(0)

return json.load(self._large_results)

except:

return {}

# Whether we are using the _large_results field

using_large_results = BooleanField(default=False)

def __get_true_result(self):

if self.using_large_results:

self._large_results.seek(0)

try:

return json.loads(self._large_results.read() or '{}')

except:

logger.exception("Error while json convering from _large_result")

raise InvalidResultError

else:

return self.results

def __set_true_result(self, result, result_class, update=False):

class_name = result_class.__name__

valid_result = self.__get_true_result()

with self.lock:

try:

current = valid_result[class_name] if update else {}

except:

current = {}

if update:

current.update(result)

else:

current = result

valid_result.update({class_name: current})

json_result = json.dumps(valid_result)

self.using_large_results = len(json_result) >= \

self.MAXIMUM_MONGO_DOCUMENT_SIZE

if self.using_large_results:

self._large_results.replace(json_result,

encoding='utf-8',

content_type='application/json')

self.results = {}

self._large_results.seek(0)

else:

self.results = valid_result

self._large_results.replace('{}', encoding='utf-8',

content_type='application/json')

We are using django with mongo deployed in cluster. Currently, I am getting this error -

mongoengine.errors.OperationError: Could not save document (Retryable write with txnNumber 4 is prohibited on session e6d643cc-8f77-4589-b754-3fddb332b1b9 - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= - - because a newer retryable write with txnNumber 6 has already started on this session.).

Any leads/help appreciated


r/StackoverReddit • • Jul 22 '24

Solved B2C Token in C# Desktop Application Missing Claims When Refreshing Silently (crosspost from dotnet)

Thumbnail self.dotnet
3 Upvotes

r/StackoverReddit • • Jul 16 '24

C# an idea about common CRUD API

3 Upvotes

 I find I was doing repetitive work in the past years,

  • change the model add/change fields,

  • update DB,

  • change API (service/controller)

  • change Page

So I think maybe I can write common CRUD API, it will serve CRUD for every entities. my model definition is not in code, but in configuration.

I invite you to check out my repo,  https://github.com/fluent-cms/fluent-cms , maybe some ideas can inspire you

My initial thought is my API should be slower than write API manually , due to I have to use another lib SQLKate to build the SQL, and using Dictionary<string, any> to read record and serialize json should be slower than a predefined c# class.

Luckily thanks for SqlKate And Dapper, the API are a little faster than EF, (the SQL generated are very similar)


r/StackoverReddit • • Jul 13 '24

Question Atomic programming of logic pieces in flow

3 Upvotes

I'm gonna write some application (python+Vuejs) aimed to ease creating small pieces of logic and constructing flow of process (like user case) with it.

How I see workflow:

  1. Define context (models, their fields and relations between them) (using chatGPT) as a prompt

... Generating and saving models, migrating to db

2. Explain behaviour of each model by as less complex of logic separate pieces as possible (atomic logic piece). Save it as blocks of logic

... Writing pieces into appropriate models

3. Use UI to compose flow of pieces and run them

I'm aware of many issues like where to store db, how to define schema and migrate it to db and so on... But now I want to try at least something

So, are there already some existing tries of it, or maybe patterns ?

PS The idea is borrowed from processors arch - how they work on commands as pieces of logic and use a bigger ones (that consist of smaller pieces)


r/StackoverReddit • • Jul 12 '24

Javascript JavaScript: PointerType pen not recognized

3 Upvotes

I have trouble detecting reliably whether a pointer event is triggered by pointerType "mouse" or "pen". I did some testing:

Windows

  • Chrome/Edge: pointerType = pen gets detected and event.button includes the correct button (either 2 or 5). But: pointerup not triggered when the pen goes from touching to hovering.

  • Firefox: Works as expected (pen vs mouse detection works and event button are correct, 2 or 5)!

Linux

  • Chromium: pointer events work as expected but event buttons are not detected correctly (0 or 1).

  • Firefox: nothing seems to work: pointerType is mouse and not pen. And event buttons are 0 or 1 instead of 2 or 5

I have a Lenovo Laptop with touchscreen.

What am I doing wrong? Or is there any other way to detect whether it is a pen or mouse input and detect the pen buttons?


r/StackoverReddit • • Jul 08 '24

Question Google earth submission issues

3 Upvotes

Hey everyone, I’m a noob and I’m having an issue with my code. When I don’t have the google earth submission functions in my code, when I hit submit it works perfectly and takes me to the formsubmit.co successful submission page but obviously doesn’t attach KML data. When I add the functions in, everything works perfect but the page stays the same and the user doesn’t know if there submission has been successful. I’ve literally been on this for 2 weeks solid so any help would be greatly appreciated.

Code can be found via the link below, thanks.

https://pastebin.com/Fhmv64xw


r/StackoverReddit • • Jul 06 '24

Question When should I apply for Internships?

3 Upvotes

I have learned basic backend and database concepts, including CRUD operations, GET, POST, PUT, DELETE, and connecting the frontend with the backend. Currently, I am learning about database querying. Can someone provide a checklist of things to learn before applying for internships or contributing to open-source projects (essentially, what to know before becoming production-ready)?


r/StackoverReddit • • Jul 05 '24

Python Using Flask for Face Mask Detection UI

3 Upvotes

I have a trained and running model and I've been successful in running it in terminal. I want to use flask for the UI where in the website I just need to access my laptop camera to open and show bounding boxes along with Mask on/off test and probability.

This is what's running in terminal: import numpy as np import cv2 from keras.models import load_model

Load the pre-trained model

model = load_model('TheTrainingModel.h5')

Load the Haar Cascade Classifier for face detection

facedetect = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')

Threshold for classifying masks

threshold = 0.6 # Adjust as needed

Initialize the webcam

cap = cv2.VideoCapture(0) cap.set(3, 640) # Set width cap.set(4, 480) # Set height

Font style for displaying text

font = cv2.FONT_HERSHEY_COMPLEX

def preprocessing(img): img = img.astype("uint8") img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) img = cv2.equalizeHist(img) img = img / 255 return img

def get_className(classNo): if classNo == 0: return "Mask" elif classNo == 1: return "No Mask"

while True: # Capture frame-by-frame success, imgOriginal = cap.read()

if not success:
    print("Failed to capture frame from the webcam. Exiting...")
    break

faces = facedetect.detectMultiScale(imgOriginal, scaleFactor=1.3, minNeighbors=5)

for x, y, w, h in faces:
    crop_img = imgOriginal[y:y+h, x:x+w]
    img = cv2.resize(crop_img, (32, 32))
    img = preprocessing(img)
    img = img.reshape(1, 32, 32, 1)
    
    prediction = model.predict(img)
    classIndex = np.argmax(prediction[0])  # Get the index of the class with highest probability
    probabilityValue = np.max(prediction)  # Get the maximum probability value
    
    # Format the text to display class and probability
    class_text = get_className(classIndex)
    probability_text = f"Prob: {probabilityValue:.2f}"
    
    # Calculate text position for mask/no mask classification (upper left)
    class_text_size, _ = cv2.getTextSize(class_text, font, 0.75, 1)
    class_text_x = x
    class_text_y = y - 10  # Adjust -10 for spacing
    
    # Calculate text position for probability (bottom left)
    probability_text_size, _ = cv2.getTextSize(probability_text, font, 0.75, 1)
    probability_text_x = x
    probability_text_y = y + h + probability_text_size[1] + 10  # Adjust 10 for spacing
    
    print(f"Class Index: {classIndex}, Probability: {probabilityValue}")
    
    # Draw bounding box and texts
    if probabilityValue > threshold:
        if classIndex == 0:
            cv2.rectangle(imgOriginal, (x, y), (x+w, y+h), (0, 255, 0), 2)
            cv2.putText(imgOriginal, class_text, (class_text_x, class_text_y), font, 0.75, (255, 255, 255), 1, cv2.LINE_AA)
            cv2.putText(imgOriginal, probability_text, (probability_text_x, probability_text_y), font, 0.75, (255, 255, 255), 1, cv2.LINE_AA)
        elif classIndex == 1:
            cv2.rectangle(imgOriginal, (x, y), (x+w, y+h), (50, 50, 255), 2)
            cv2.putText(imgOriginal, class_text, (class_text_x, class_text_y), font, 0.75, (255, 255, 255), 1, cv2.LINE_AA)
            cv2.putText(imgOriginal, probability_text, (probability_text_x, probability_text_y), font, 0.75, (255, 255, 255), 1, cv2.LINE_AA)

cv2.imshow("Result", imgOriginal)

# Check for key press event (press 'q' to quit)
k = cv2.waitKey(1)
if k == ord('q'):
    break

cap.release() cv2.destroyAllWindows()

This is my flask app: from flask import Flask, render_template, Response import cv2 import numpy as np from keras.models import load_model

app = Flask(name, static_folder='static', template_folder='templates')

Load the pre-trained model

model = load_model('TheTrainingModel.h5')

Load the Haar Cascade Classifier for face detection

facedetect = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')

Threshold for classifying masks

threshold = 0.6 # Adjust as needed

Font style for displaying text

font = cv2.FONT_HERSHEY_COMPLEX

def preprocessing(img): img = img.astype("uint8") img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) img = cv2.equalizeHist(img) img = img / 255 return img

def get_className(classNo): if classNo == 0: return "Mask" elif classNo == 1: return "No Mask"

def generate_frames(): cap = cv2.VideoCapture(0) cap.set(3, 640) # Set width cap.set(4, 480) # Set height

while True:
    success, imgOriginal = cap.read()
    if not success:
        break

    faces = facedetect.detectMultiScale(imgOriginal, scaleFactor=1.3, minNeighbors=5)
    for x, y, w, h in faces:
        crop_img = imgOriginal[y:y+h, x:x+w]
        img = cv2.resize(crop_img, (32, 32))
        img = preprocessing(img)
        img = img.reshape(1, 32, 32, 1)

        prediction = model.predict(img)
        classIndex = np.argmax(prediction[0])  # Get the index of the class with highest probability
        probabilityValue = np.max(prediction)  # Get the maximum probability value

        # Format the text to display class and probability
        class_text = get_className(classIndex)
        probability_text = f"Prob: {probabilityValue:.2f}"

        # Calculate text position for mask/no mask classification (upper left)
        class_text_size, _ = cv2.getTextSize(class_text, font, 0.75, 1)
        class_text_x = x
        class_text_y = y - 10  # Adjust -10 for spacing

        # Calculate text position for probability (bottom left)
        probability_text_size, _ = cv2.getTextSize(probability_text, font, 0.75, 1)
        probability_text_x = x
        probability_text_y = y + h + probability_text_size[1] + 10  # Adjust 10 for spacing

        # Draw bounding box and texts
        if probabilityValue > threshold:
            if classIndex == 0:
                cv2.rectangle(imgOriginal, (x, y), (x+w, y+h), (0, 255, 0), 2)
                cv2.putText(imgOriginal, class_text, (class_text_x, class_text_y), font, 0.75, (255, 255, 255), 1, cv2.LINE_AA)
                cv2.putText(imgOriginal, probability_text, (probability_text_x, probability_text_y), font, 0.75, (255, 255, 255), 1, cv2.LINE_AA)
            elif classIndex == 1:
                cv2.rectangle(imgOriginal, (x, y), (x+w, y+h), (50, 50, 255), 2)
                cv2.putText(imgOriginal, class_text, (class_text_x, class_text_y), font, 0.75, (255, 255, 255), 1, cv2.LINE_AA)
                cv2.putText(imgOriginal, probability_text, (probability_text_x, probability_text_y), font, 0.75, (255, 255, 255), 1, cv2.LINE_AA)

    ret, buffer = cv2.imencode('.jpg', imgOriginal)
    frame = buffer.tobytes()
    yield (b'--frame\r\n'
           b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')

cap.release()

@app.route('/') def index(): return render_template('index2.html')

@app.route('/video_feed') def video_feed(): return Response(generate_frames(), mimetype='multipart/x-mixed-replace; boundary=frame')

if name == "main": app.run(debug=True)

And finally this is my html file: <!DOCTYPE html>

<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Face Mask Detection</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f0f0; margin: 0; } .container { text-align: center; } img { width: 640px; height: 480px; border: 2px solid #ccc; border-radius: 10px; } </style> </head> <body> <div class="container"> <h1>Face Mask Detection</h1> <img src="{{ url_for('video_feed') }}" id="video" autoplay> </div> <script src="{{ url_for('static', filename='js/script.js') }}"></script> </body> </html>