Beispiel #1
0
def brisque_metric(img_tile):

    brisq = brisque.BRISQUE()
    score = brisq.get_score(img_tile)

    return score
Beispiel #2
0
def my_brisque(img):
    brisq = brisque.BRISQUE()
    brisq.get_feature(img)
    return brisq.get_score(img)
Beispiel #3
0
import os
import argparse
import sys
import json
from libsvm import svmutil
import brisque
import PIL.Image
import pytesseract
from shutil import rmtree

connection = pymongo.MongoClient("mongodb://localhost:27017/")
db = connection["sous"]
recipe_collection = db["recipe"]

target_folder = '/run/media/anfa/1C8A5B0249DD18B9/h32/'
b = brisque.BRISQUE()

for dirpath, dirs, files in os.walk(target_folder):
    for di in dirs:
        for dirpath, dirs, files in os.walk(target_folder + di):
            fs = files
            scores = []
            raw_scores = []
            position = 0

            if files:
                for f in fs:
                    if f != 'hold':
                        path = dirpath + '/' + f
                        img = PIL.Image.open(path)
                        width, height = img.size
Beispiel #4
0
def score(img):
    brisq=br.BRISQUE()
    feats=brisq.get_feature(img)
    err=brisq.get_score(img)
    print("Brisque Score: "+str(err))
    return err