The Django web framework consists of multiple modules or packages that allow developers to quickly write the application without having to engineer an app’s backend from scratch. Django is considered a full-stack web framework because it combines a database, application server, template engine, authentication modules and dispatcher to create a high-level framework.

In this article we’ll review the top 8 most-used Django packages in the industry. These packages can assist with REST APIs, views, forms, debug tools, data relationships, and more.

1. Django-rest-framework

Django-rest-framework is one of the best packages for creating APIs with Django. …


YOLOv3 is the latest variant of a popular object detection algorithm YOLO — You Only Look Once. The published model recognizes 80 different objects in images and videos, but most importantly it is super fast and nearly as accurate as Single Shot MultiBox (SSD).

Starting with OpenCV, you can easily use YOLOv3 models in your own OpenCV application.

How does YOLO work ?

We can think of an object detector as a combination of a object locator and an object recognizer.

In traditional computer vision approaches, a sliding window was used to look for objects at different locations and scales…


The Django’s built-in authentication system is great. For the most part we can use it out-of-the-box, saving a lot of development and testing effort. It fits most of the use cases and is very safe. But sometimes we need to do some fine adjustment so to fit our Web application.

Commonly we want to store a few more data related to our User. If your Web application have an social appeal, you might want to store a short bio, the location of the user, and other things like that.

In this tutorial I will present the strategies you can use…


For loop is an essential aspect of any programming language.

In python, for loop is very flexible and powerful.

In this tutorial, we’ve explained the following Python for loop examples.

  1. Python For Loop for Numbers
  2. Python For Loop for Strings
  3. Python For Loop Using Default Range Function
  4. Python For Loop With Custom Start and End Numbers
  5. Python For Loop With Incremental Numbers
  6. Python For Loop Range with Negative Values
  7. Continue Statement Inside Python For Loop
  8. Break Statement Inside Python For Loop
  9. Can a For Loop itself have an Else without If?
  10. Else and Break Combination Behavior Inside Python For
  11. Nested…

In this tutorial, we will look at some common mistakes that are often made by Django developers and ways to avoid them. This tutorial is useful even if you’re a skilled Django developer because mistakes, like maintaining an unmanageably large settings or naming conflicts in static assets, aren’t just limited to new developers taking their first stab at Django.

Django is a free and open source Python web framework that helpfully solves common development challenges and allows you build flexible, well-structured applications. Django has a lot of modern features out of the box. For me personally, the Admin, Object Relational…


How we made Django admin faster by adding a new type of filter

When creating a new Django Admin page a common conversation between the developer and the support personal might sound like this:

Developer: Hey, I’m adding a new admin page for transactions. Can you tell me how you want to search for transactions?

Support: Sure, I usually just search by the username.

Developer: Cool.

search_fields = (
user__username,
)

Anything else?

Support: I sometimes also want to search by the user email address.

Developer: OK.

search_fields = (
user__username,
user__email,
)

Support: And the first and last name of course.

Developer: Yeah, OK.

search_fields = (
user__username,
user__email,
user__first_name,
user__last_name,
)


you can execute a script when Nano Pi boots up.

You can add your script executable command to the bottom of .bashrc that will run your script every time open a terminal (or run a new instance of bash).

1. Make sure you are in the pi folder:

$ cd ~

2. Create a file and write a script to run in the file:

$ sudo nano run.sh

3. Save and exit: Ctrl+X, Y, Enter

4. Open up .bashrc for configuration:

$ sudo nano .bashrc

.bashrc is NOT intended to run scripts. It is run each time a non-login interactive…


github link for this project:
https://github.com/atrotech/comtest

How to build

# git clone https://github.com/atrotech/comtest.git
# cd comtest
# gcc -o comtest comtest.c

Usage

./comtest -d /dev/ttyAMA3 -s 38400

Parameters

# ./comtest --help
comtest - interactive program of comm port
press [ESC] 3 times to quit
Usage: comtest [-d device] [-t tty] [-s speed] [-7] [-c] [-x] [-o] [-h]
-7 7 bit
-x hex mode
-o output to stdout too
-c stdout output use color
-h print this help

comtest.c :

# include <stdio.h>
# include <stdlib.h>
# include <termio.h>
# include <unistd.h>
# include <fcntl.h>
# include <getopt.h>
# include <time.h>
# include <errno.h>
# include <string.h>
static…

Overview

Lane detection is one of the most crucial technique of ADAS and has received significant attention recently. In this project, we achived lane detection with real time by numpy and multi-thread.

Dependencies

  • Python
  • Numpy
  • Opencv

How to Run

Run lane_detection.py. The default video is project_video, if you want to process the "fog_video.mp4", change video_index to 1 in line 9.

Demo Image

full source code:

import numpy as np
import cv2
import time
from threading import Thread
from queue import Queue
# defualt video number, if you want to process the "fog_video.mp4", change video_index to 1
video_index = 0
# the result of lane detection, we add…

https://github.com/nimadorostkar/images-difference

fuul code:

from skimage.measure import compare_ssim
import argparse
import imutils
import cv2


# load the two input images
imageA = cv2.imread('0.jpg')
imageB = cv2.imread('1.jpg')

# convert the images to grayscale
grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)
grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)
# compute the Structural Similarity Index (SSIM) between the two
# images, ensuring that the difference image is returned
(score, diff) = compare_ssim(grayA, grayB, full=True)
diff = (diff * 255).astype("uint8")
print("SSIM: {}".format(score))
# threshold the difference image, followed by finding contours to
# obtain the regions of the two input images that differ
thresh = cv2.threshold(diff, 0, 255,
cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1]
cnts = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL,
cv2.CHAIN_APPROX_SIMPLE)
cnts…

Nima dorostkar

I’m Nima , CTO at Atrotech based in Tehran. Django developer and enthusiastic in CV, IOT, AI and data-driven technologies.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store