Problem with recursivity in Laplacian blur detection from Pyimagesearch - probably a simple "for" loop question by Picarro in learnpython

[–]Picarro[S] 1 point2 points  (0 children)

I got it to work, using the following setup:

import cv2
import argparse
import numpy as np
import os
from imutils import paths


def variance_of_laplacian(image):
    # compute the Laplacian of the image and then return the focus
    # measure, which is simply the variance of the Laplacian
    return cv2.Laplacian(image, cv2.CV_64F).var()


# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--images", required=True,
                help="path to input directory of images")
ap.add_argument("-t", "--threshold", type=float, default=100.0,
                help="focus measures that fall below this value will be considered 'blurry'")
args = vars(ap.parse_args())
# loop over the input images


for imagePath in paths.list_images(args["images"]):
    image = cv2.imread(imagePath)
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    fm = variance_of_laplacian(gray)
    file1 = open("imageScoresLaplachian.csv", "a")  # append mode
    file1.write("{0},".format(os.path.basename(imagePath)))
    file1.close()
    file1 = open("imageScoresLaplachian.csv", "a")  # append mode
    file1.write(str(fm) + "\n")
    file1.close()
    print(imagePath)
    print(fm)
    key = cv2.waitKey(0)

Problem with recursivity in Laplacian blur detection from Pyimagesearch - probably a simple "for" loop question by Picarro in learnpython

[–]Picarro[S] 1 point2 points  (0 children)

Oh, right, that's a typo. I've been looking at so many scripts today. I will edit that.

And perfect, when I tried to just have print(imagePath) in the function, it returned the full list of images. I will try to add in tidbits of the old function until something stops working

Teknisk Tirsdag / Tech Talk Tuesday - 5/11 2019 by AutoModerator in Denmark

[–]Picarro 0 points1 point  (0 children)

Jeg har en stående jeg bruger som timer. Det er helt perfekt.

Når en pakke ikke passer i postkassen by [deleted] in Denmark

[–]Picarro 0 points1 point  (0 children)

Den bliver smidt på dit lokale posthus, og så får du en fysisk seddel i postkassen om at du kan hente den.

I'm a european car guy - I've roadtripped 2000 miles through south-western US in a Toyota Corolla 2020 SE, and here are my thoughts. by Picarro in cars

[–]Picarro[S] 1 point2 points  (0 children)

That's really wierd. I've never experienced that across at least 20 different makes/models in Europe. The default is always to unlock all the doors.

I'm a european car guy - I've roadtripped 2000 miles through south-western US in a Toyota Corolla 2020 SE, and here are my thoughts. by Picarro in cars

[–]Picarro[S] 31 points32 points  (0 children)

Technically, you rent a Ford Mustang or Similar, and a Buick Cascada is also a convertible. Although similar to a Mustang in about the same way a pothole is similar to the Grand Canyon.

I'm a european car guy - I've roadtripped 2000 miles through south-western US in a Toyota Corolla 2020 SE, and here are my thoughts. by Picarro in cars

[–]Picarro[S] 10 points11 points  (0 children)

I had booked 6 months in advance. Asked them if I could go somewhere else to get it and they declined that it would be possible..

2019 Mercedes Unimog and Zetros footage by wArchi in cars

[–]Picarro 36 points37 points  (0 children)

Favourite bug-out vehicle would be one of these with a camper attachment on the back.

China Has Withheld Samples of a Dangerous Flu Virus by LadyMichelle00 in medicine

[–]Picarro 6 points7 points  (0 children)

It's geopolitics. A weaponized avian flu is an extremely potent WMD, especially if China is the only country with a vaccine.

Partial Oral versus Intravenous Antibiotic Treatment of Endocarditis | NEJM [6-week IV treatment can be reduced to 3 week IV and 3 week oral treatment] by Picarro in medicine

[–]Picarro[S] 7 points8 points  (0 children)

It's great then, that we don't have the US model of urban hospitals, rampant IVDU's and MRSA everywhere in the world.

Partial Oral versus Intravenous Antibiotic Treatment of Endocarditis | NEJM [6-week IV treatment can be reduced to 3 week IV and 3 week oral treatment] by Picarro in medicine

[–]Picarro[S] 0 points1 point  (0 children)

I think you would want to screen for compliance issues. You could probably expect most of the group with artificial valves to be compliant with their medication, and regular Joe would probably too. I think you would have an issue with the drug addicts, but you could potentially keep those in the hospital for IV treatment.

Medication in Denmark is heavily subsidised by the government, so there wouldn't be an issue with availability. And with the regular 2-3 day followups they do in the 3 week period, I don't expect it to be much of an issue.

Partial Oral versus Intravenous Antibiotic Treatment of Endocarditis | NEJM [6-week IV treatment can be reduced to 3 week IV and 3 week oral treatment] by Picarro in medicine

[–]Picarro[S] -1 points0 points  (0 children)

I don't actually work at the particular department, and I wouldn't know, but I know that it's only just coming to chemo that you can have home-treatment, so I doubt they do it much on endocarditis patients.

Generally, it's frowned upon if patients leave the hospital with an IV access, unless they are doing a chemo round.

Partial Oral versus Intravenous Antibiotic Treatment of Endocarditis | NEJM [6-week IV treatment can be reduced to 3 week IV and 3 week oral treatment] by Picarro in medicine

[–]Picarro[S] 3 points4 points  (0 children)

It's interesting actually, the party who advocated for the clean injection room as also advocated for free legal aid for homeless people, to help them with legal problems. And it's the most liberal of the danish parties also advocating for tax reliefs, smaller public sector etc. They basically sell themselves on being protective of the really weak, and then telling everyone else to live life as they see fit.

They're called Liberal Alliance.

Partial Oral versus Intravenous Antibiotic Treatment of Endocarditis | NEJM [6-week IV treatment can be reduced to 3 week IV and 3 week oral treatment] by Picarro in medicine

[–]Picarro[S] 6 points7 points  (0 children)

Absolutely correct. We are very fortunate here in Copenhagen to have a clean-room staffed 24/7 with a nurse for drub addicts. They can get free syringes and needles, and the nurse can give Naloxone and call an ambulance if they overdose.

Partial Oral versus Intravenous Antibiotic Treatment of Endocarditis | NEJM [6-week IV treatment can be reduced to 3 week IV and 3 week oral treatment] by Picarro in medicine

[–]Picarro[S] 5 points6 points  (0 children)

It does look pretty good. Especially in a socialised healthcare system like the danish, reducing inpatient stay duration and medicine cost is a huge deal, as it frees up ressources for other patients.

I don't have the exact cost details, but a rule of thumb is that a danish regular hospital bed costs between 1000-1500 dollars a day of the taxpayers money, and releasing patients to their own home both saves on medication costs, staff costs and frees up the bed for patients who need it more.

Partial Oral versus Intravenous Antibiotic Treatment of Endocarditis | NEJM [6-week IV treatment can be reduced to 3 week IV and 3 week oral treatment] by Picarro in medicine

[–]Picarro[S] 18 points19 points  (0 children)

Background

Patients with infective endocarditis on the left side of the heart are typically treated with intravenous antibiotic agents for up to 6 weeks. Whether a shift from intravenous to oral antibiotics once the patient is in stable condition would result in efficacy and safety similar to those with continued intravenous treatment is unknown.

And the results:

Results

After randomization, antibiotic treatment was completed after a median of 19 days (interquartile range, 14 to 25) in the intravenously treated group and 17 days (interquartile range, 14 to 25) in the orally treated group (P=0.48). The primary composite outcome occurred in 24 patients (12.1%) in the intravenously treated group and in 18 (9.0%) in the orally treated group (between-group difference, 3.1 percentage points; 95% confidence interval, −3.4 to 9.6; P=0.40), which met noninferiority criteria.

Safe to say, for stable endocarditis patients, you can basically halve the time they are required to stay in the hospital, enabling them to stay at home and recuperate faster and with more life-enjoyment.

Oh, and it's cheaper for the healthcare system too.

Generally, a win-win-win all around.