<jupyter_start><jupyter_text>Count Number of Cars in Less Than 10 Lines of Code Using Python Read full article here https://towardsdatascience.com/count-number-of-cars-in-less-than-10-lines-of-code-using-python-40208b173554<jupyter_code>!pip install cvlib==0.2.2
!pip install opencv-python==4.1.1.26
!pip install tensorflow==1.14.0
!pip install matplotlib==3.1.1
!pip install Keras==2.2.5
from platform import python_version
import tensorflow
import keras
import cvlib as cv
import cv2

print('Python version: {}'.format(python_version()))
print('cvlib version: {}'.format(cv.__version__))
print('OpenCV version: {}'.format(cv2.__version__))
print('Tensorflow version: {}'.format(tensorflow.__version__))
print('Keras version: {}'.format(keras.__version__))
import cv2
import matplotlib.pyplot as plt
import cvlib as cv
from cvlib.object_detection import draw_bbox

# Uncomment this to read image from local folder/directory
#im = cv2.imread('cars.jpeg')

# Comment the above line to read image from local folder/directory and Uncomment the following two lines if you are reading imgae from a url
#from skimage import io
#im = io.imread('http://www.samacharnama.com/wp-content/uploads/2019/06/third-party-insurance..687.png')

plt.imshow(im)
plt.show(None)

bbox, label, conf = cv.detect_common_objects(im)
output_image = draw_bbox(im, bbox, label, conf)
plt.imshow(output_image)
plt.show()
print('Number of cars in the image is ' + str(label.count('car')))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12441156691324814, 'fraction_numerical': 0.03093476798924008, 'mean_word_length': 5.920930232558139, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '613337', 'license': 'MIT', 'n_tokens_mistral': 533, 'n_tokens_neox': 496, 'n_words': 136, 'path': 'Count_Number_of_Cars_in_Less_Than_10_Lines_of_Code_Using_Python.ipynb', 'repo_name': 'sabiipoks/blog-posts', 'size': '1487'}