How to put live video from web camera to Django website? - python

I have developed a face recognition software.It detects and identify human faces infront of the connected web camera.Now I need to deploy it in a website.so that,Anyone with a computer should be able to access this service through this website and should be able to perform face detection and identification using the camera in his premises.
Is it possible to integrate python application with website?
Is Django framework is suitable for my work?
Can anybody recommed any tutorials in this direction?

This has got absolutely nothing to do with Django. Django is running in your server, whereas you need to capture image at your client. Therefore it has to do about your front-end and not your back-end.
Traditionally this has been a feature not at all possible. A web browser could not access the client's peripherals and end of story. Flash, activex etc have been workarounds for this.
HTML5 now allows it. Read more on MDN about MediaDevices.getUserMedia().
Unfortunately this is still fresh at the time of writing and is only supported by some browser versions: read more on caniuse.com.
You could use some js library for feature detection such as modernizr.

Related

Integration of Python ML Model with a web application

Let us assume that, I have a Machine Learning model which uses the Tensorflow library and performs a function.
And of course, the function requires input and provides some output. Which can be easily done on my terminal.
Here comes the area where I need help, IO in the terminal is not what I wanted, I want to create a web application that has multiple functionalities. Let us only consider the area where my ML model has to work, say when I click a button after entering the inputs it runs the ML model back and provides me an output which I could display it on my web application.
I can develop websites with NodeJs. Is there any possibility of integrating the ML model with my web application made of NodeJs?
I tried running on some packages like child-process,python-shell nothing works, it gives me an error when it comes to the place of importing packages.
Please give me suggestions on the Integration of the ML model with a NodeJS web application using MongoDB as a database. All I wanted is that my web application runs my ML model wherever necessary to obtain the results which I can display through my web applications.
Also, provide information about technologies that can be easily integrated with the Machine learning model.
I'm also encountering similar problems.
Further to the previous reply, I would go for the micro services architecture design.
E.g. Use a node.js app to serve the front-end request, and the Python server only to serve the machine learning tasks.
You need to build a python web application around your model to serve responses (your model’s output) to the client (the webpage your nodejs app is serving).
Flask and Django are the major players there. REST is the most popular meta-framework.
Once you’ve built a REST API around your model, you just query it like any resource via HTTP/xmlhttprequest in JavaScript from your web page.
Or you can try to pickle your model and load into into JavaScript to query from your nodejs app.
Easier than either of those would be to use IBM Cloud Functions or AWS Lambda to expose your script/model. Very easy and cost effective.

Upload stock images Appium iOS Simulator

My application allows for users to upload a picture of themselves. The iOS simulator comes with stock images. How would I go about using one of those stock images for the image upload?
After clicking on the element that allows for users to upload images I receive the iOS popup:
I select "Album" but when using the Appium inspector it does not allow any access to these images, I am not able to select any (as seen in the screenshot)
I doubt if its possible to parse this screen since its already other app: Photos app.
With Appium you can interact only with the app that is signed same certificate as WebDriverAgent. At least its valid for real devices, but since you are not able to parse with Appium Desktop my guess its still the same for simulator.
You might try to use TouchAction/tap by coordinates (less stable, but quick way to go) or have integrate image recognition library, e.g. sikuli in your code (more work, but clearly more stable) to select images in Photos app

How to put my DialogFlow chatbot with python on line?

I am developing a chatbot using DialogFlow, as my natural language processing handler, and Python as my client.
My application aims to talk with a human in a python environment (I am currently using a Jupyter Notebook), send the request to DialogFlow, get the response, then calculate the data using some python libraries and show the results to the user.
All the process described above is already working.
Now I must to find a way that lets the people uses my chatbot on line.
Here is my problem, I don't know how to model this.
I think I should put my chatbot in a webpage and make it communicate with my python application stored in a server.
Did anybody make something similar?
Given your current architecture, you'll have to do the following:
Write a client for your chatbot in HTML and JavaScript
Write a server in Python that contains your application logic and makes the API calls to Dialogflow
This is a pretty normal architecture for a web application. Given that you're using Python, you might find Flask or Django helpful.
There should be plenty of samples out there that can help you figure out what to do; I just found this blog post that demonstrates how to build a simple chat client/server with Flask and websockets.
If you're willing to change your architecture so that the user interacts directly with Dialogflow, and all of your application logic lives in the Dialogflow fulfillment webhook, you can make use of Dialogflow's Web Demo integration that provides a pre-built chat widget you can embed into an HTML page.

Does Video.io support Xamarin forms

I want to integrate a video and text chat for web (python) and mobile (xamarin). The requirement is to make customers able to communicate across platforms i.e mobile to web and vice versa.
Mobile application will be developed using Xamarin technology and the website will be in Python.
Is video supported by both platforms?
Yes it does, check out the vidyo.io Xamarin sample on github - https://github.com/Vidyo/VidyoConnector-xamarin
Note that vidyo.io SDK runs on the client end. That means it will either run on your mobile device (using native libraries or in your case using Xamarin), or in case of web sites it will use javascript. You do not need to integrate vidyo.io SDK on the server side.
On your server, what you will need, is to generate "tokens" whenever your client device or website wants to connect to a video conference.
Since you are using python you can take a look at their sample token generator at https://static.vidyo.io/4.1.16.8/utils/generateToken.py
You can learn more about tokens on their website -
https://developer.vidyo.io/documentation/4-1-16-8/getting-started#Tokens

Streaming videos with Django

I have a Django application and I want to create a UI from which users will be able to play videos. Videos are dynamically generated and saved on my web server.
I am running a Django application on an Apache web-server through mod_wsgi. It takes a long time to buffer/load video; please suggest how can I improve it. I am using Ubuntu Server with 16 GB RAM, quad core processor and 1 TB SSD.
I would suggest using a cloud provider such as Amazon Web Services.
Have a look at django-storages, this will help you get your videos from django up to AWS. You'll store your video's on Amazon's S3, then, if you have an international audience use CloudFront to stream. You can use RTMP to do this (that's "proper" streaming as apposed to incremental download while playing).
On the browser side you probably just want to use the <video> tag (see MDN). You'll be saving the source attribute of the video (a reference to the location of the video on cloudfront) on your django model and then adding it into your templates.

Categories

Resources