euagendas / m3inference

A deep learning system for demographic inference (gender, age, and individual/person) that was trained on massive Twitter dataset using profile images, screen names, names, and biographies
http://www.euagendas.org
GNU Affero General Public License v3.0
145 stars 57 forks source link

add support to disable all logs and tqdm bars #18

Closed zijwang closed 3 years ago

zijwang commented 3 years ago

based on https://github.com/euagendas/m3inference/pull/17

Test:

> python scripts/preprocess.py --source_dir test/pic/ --output_dir test/pic_resized/ --jsonl_path test/data.jsonl --jsonl_outpath test/data_resized.jsonl --skip_logging
(no output)
>>> from m3inference import M3Inference
>>> import pprint
>>> m3 = M3Inference(skip_logging=True)
>>> pred = m3.infer('./test/data_resized.jsonl') # also see docstring for details
>>> pprint.pprint(pred)
OrderedDict([('720389270335135745',
              {'age': {'19-29': 0.1546,
                       '30-39': 0.114,
                       '<=18': 0.0481,
                       '>=40': 0.6833},
...
Jaggler3 commented 3 years ago

Hey @zijwang I just cloned this branch and tested with M3Inference and M3Twitter and the skip_logging option works great! This works for my use case.

zijwang commented 3 years ago

Sounds good. Thanks, @Jaggler3 ! I will get the PR merged.