Pneumonia is a highly dangerous state that poses serious risks to the health of a patient. In contrast to common pneumonia, lung disease COVID-19 causes a large number of lethal outcomes. The pneumonia of a viral etiology caused by the RNA virus SARS-CoV-2 is visually hardly distinguishable from the bacterial pneumonia or inflammation caused by other viral infections. Now, COVID-19 can be diagnosed using PCR tests or X-rays of the thoracic cage. However, the results of a molecular study take a long time to prepare. In contrast, the radiological images of the thoracic cage can be obtained immediately after the radiological study. Although there exist guiding principles which help radiologists to differentiate COVID-19 from other types of infections, their assessments differ. In addition, doctors who are not radiologists can be assisted in better locating the disease, for instance, by a bounding box. Development of precise computer methods based on artificial intelligence can help medical workers in quickly determining the type of pneumonia and detecting the loci of inflammation. In this study a package of methods is developed to determine the type of pneumonia and detect the ground-glass loci using the appropriate architectures of neural networks, loss functions, augmentations at the training data generation stage, test time augmentation, and computer vision model ensembles. This task is successfully solved in the SIIM-FISABIO-RSNA COVID-19 Detection competition [17] and the proposed algorithm is in the top 10% of the best solutions.