I suspect its less to do with actual, objective legibility and more to do with patient anxiety. The things that doctors (and pharmacists, etc) hand-write tend to be personally important.
That's not really realistic, it can't even do normal cursive handwriting with first capital letter joined, I dunno anyone who writes like any of those 10 styles, maybe they are common in US, but certainly not in this part of Europe.
Get back to me when it will knows at least something like this:
> That's not really realistic, it can't even do normal cursive handwriting
There is no such thing as "normal cursive". Cursive as a general style is primarily defined by joined characters, which this generator definitely does, in contrast to print writing which has separated characters.
Even formal cursive writing systems vary wildly in style and construction, and I'd venture a guess that vast majority of people do in practice have pretty sloppy style.
All styles I tried have first capitalized letter separated (not joined as it should be properly) and written in print writing, that's not really cursive by my standards.
There exist handwriting styles that have been standardised by their national ministry of education or similar, and millions of school children each year learn it. It is true that quite soon the individual's styles diverge from the normal form.
A large number of handwriting synthesis demos are derivations of/inspired by Alex Graves's paper "Generating Sequences With Recurrent Neural Networks". Alex's code is available under GPL-3.0 here, https://sourceforge.net/projects/rnnl/. One could also port the techniques described in the paper, https://arxiv.org/abs/1308.0850 using any modern machine learning framework.
Looks lovely. Are you planning to add diacritics or Latin ext characters, (ä, ł, õ)? I'm curious how an animation with them would look as normally I'd apply them either after each word or after a bigger chunk of a word.
I've had a project idea similar to this in the backlog for years: personalized signature generator that can be used to deal with dinosaurs that still want printed, scanned and signed documents.
Basically I want to take a pdf, turn it into fake scan image (add noise, some inkjet smear lines, random skew etc procedurally), then generate signature image to paste over that. Zero dead trees and screaming at printers involved.
These fake-scanner pdf generators always use a huge skew. A tiny (random) bit of skewing makes it seem more genuine, but using the same exact large rotation puts it in an uncanny valley.
It is trivially recognizable in PDF viewers like Adobe Reader that a signature image was pasted in (the image rectangle around the signature highlights), and can therefore be rejected as not being a genuine signature, unless you turn the whole page into an image to make it look like a scan.
Make a very high-quality noise-free image of your signature, with a transparent background. Drop it onto an equally high-quality PDF and skew it a bit. Add some toner noise to the whole image and skew the image a small bit.
I think you can make it look decent. Haven't tried it though.
Just yesterday I scanned my signature and added it to Adobe Reader. It even automatically made it transparent in a correct way. It didn’t add noise though.
I scanned my signature at high resolution from blank white paper, cleaned it up a little with Paint.net, and made the white areas transparent. Pasting that into documents has saved me a lot of hassle.
Legally I'm pretty sure you could also just draw an X on there and you'd be fine.
As another user pointed out, it can't correctly write accented vowels. Curiously, it writes them quite differently if I add spaces between them, like it was attempting to translate the appearance of characters rather than picking them from a ascii table.
How would that be able to work? - as it doesn't write the same character exactly the same twice, with both random variation and adapting the letters either side.
So now I just need to go ask this startup to see their logs. I'll get your IP address in no time. Maybe I'll need a warrant. But I'm sure these guys will just be very nice and send me their logs on an ongoing basis.
It would probably look a lot like handwritten kanji.
Asking various stable diffusion implementations, it looks like it agrees with me at least a little. When anything close to what I want is generated it tends to actually contain kanji like fire and life.
I run it few times and some in some variants algorithm just gives up and produces some noodles similar to "szlaczki" - the patterns kids train before starting hand writing. Definitely the issue of diacritical mark presence - maybe the input should pick the closest "clean" Latin letter before algorithm becomes aware of accents?
I always wondered if pharmacists had any specific training in the terrible handwriting doctors put on prescriptions, or if they all just figure it out in their first year.
> I always wondered if pharmacists had any specific training in the terrible handwriting doctors put on prescriptions
One day my local pharmacist was in a chatty mood whilst filling my request and one topic that came up was doctor's handwriting.
The answer is yes, they do (did ?) receive training in handwriting recognition.
Basically it involves learning to recognise common abbreviations and mostly being very familiar with drug names and dosing.
As the pharmacist said, when he received his training it was "easy" because the formulary was "somewhat shorter" than it is today. As a result he said his junior trainees struggle and frequently come to him guidance until they've had sufficient exposure.
However with things moving to electronic prescriptions the days of deciphering will be relic of the past for many pharmacists.
This reminded me, I once attended a lecture by a pharmacist who got interested in handwriting and showed how different conditions and medications might manifest in customers' handwriting.
Looking at the samples, it was pretty fascinating.
Since he undoubtedly read a lot of doctors' writing too, and since I personally know a doctor who abused their access to medication, I did wonder what questions this pharmacist would've had about local doctors...
I have the feeling that the amount of programmers whose minimum acceptable standard for code is on the level of "garbage in, garbage out" is on the rise. I condemn this development, that's a lack of role models who can transmit the values of culture and discipline.
If I had written that software, I would have made an effort to support the complete Latin script, or at the very least shown an error or a warning for unsupported letters.
Looks like it's based on this paper [1]. It's a recurrent neural network trained on online handwriting data. It means you record how the position of the tip of the pen changes as you write. The training data comes from the IAM On-Line Handwriting Database which has only handwritten English text.
If you want to support a complete Latin script, you would have to generate a lot of training data yourself, preferably in multiple languages. Quite the effort indeed.
246 comments
[ 2.9 ms ] story [ 276 ms ] threadhttps://imgur.com/a/l5X7oBL
Can’t even fit the “Tears in Rain” soliloquy from Blade Runner :/
I wonder how it comes to be.
Get back to me when it will knows at least something like this:
https://qph.cf2.quoracdn.net/main-qimg-5d1b0e1d28c12813e1255...
or here especially 1st and 3rd line https://d50-a.sdn.cz/d_50/c_img_E_C/3VfFjd.jpeg
Then we can talk about REALISTIC handwriting.
There is no such thing as "normal cursive". Cursive as a general style is primarily defined by joined characters, which this generator definitely does, in contrast to print writing which has separated characters.
Even formal cursive writing systems vary wildly in style and construction, and I'd venture a guess that vast majority of people do in practice have pretty sloppy style.
http://enwp.org/Teaching_script
There exist handwriting styles that have been standardised by their national ministry of education or similar, and millions of school children each year learn it. It is true that quite soon the individual's styles diverge from the normal form.
That's probably a lot to ask.
Has anybody got tips about interesting datasets in that space?
https://github.com/sjvasquez/handwriting-synthesis
Basically I want to take a pdf, turn it into fake scan image (add noise, some inkjet smear lines, random skew etc procedurally), then generate signature image to paste over that. Zero dead trees and screaming at printers involved.
I think you can make it look decent. Haven't tried it though.
Legally I'm pretty sure you could also just draw an X on there and you'd be fine.
alphabet = [ '\x00', ' ', '!', '"', '#', "'", '(', ')', ',', '-', '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '?', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'Y', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' ]
That seems to explain why it fails on capital X/Q and doesn't fail on lowercase x/q.
Seems like these characters were not present in training data
A case for polish: „Zażółć gęślą jaźń” - fails in many gunny ways.
I also tried emojis - of course it failed, but now I’m super curious how would hand written emojis look like :D
Asking various stable diffusion implementations, it looks like it agrees with me at least a little. When anything close to what I want is generated it tends to actually contain kanji like fire and life.
I run it few times and some in some variants algorithm just gives up and produces some noodles similar to "szlaczki" - the patterns kids train before starting hand writing. Definitely the issue of diacritical mark presence - maybe the input should pick the closest "clean" Latin letter before algorithm becomes aware of accents?
One day my local pharmacist was in a chatty mood whilst filling my request and one topic that came up was doctor's handwriting.
The answer is yes, they do (did ?) receive training in handwriting recognition.
Basically it involves learning to recognise common abbreviations and mostly being very familiar with drug names and dosing.
As the pharmacist said, when he received his training it was "easy" because the formulary was "somewhat shorter" than it is today. As a result he said his junior trainees struggle and frequently come to him guidance until they've had sufficient exposure.
However with things moving to electronic prescriptions the days of deciphering will be relic of the past for many pharmacists.
Looking at the samples, it was pretty fascinating.
Since he undoubtedly read a lot of doctors' writing too, and since I personally know a doctor who abused their access to medication, I did wonder what questions this pharmacist would've had about local doctors...
If I had written that software, I would have made an effort to support the complete Latin script, or at the very least shown an error or a warning for unsupported letters.
If you want to support a complete Latin script, you would have to generate a lot of training data yourself, preferably in multiple languages. Quite the effort indeed.
1 - https://arxiv.org/pdf/1308.0850.pdf
It's a very cool prototype but missing a LOT.