I am working on the .md file in the following location:
https://github.com/markroche92/SDND-Traffic-Sign-Classification/blob/master/writeup_template.md
None of my linked images are appearing when I view the .md file in Github. I have used the following markdown code to attempt to link the images:
---
**Build a Traffic Sign Recognition Project**
[//]: # (Image References)
[image1]: ./histogram_input_data.png "Input_Data"
[image2]: ./Label26.png "Label_26"
[image3]: ./Label36.png "Label_36"
[image4]: ./Label41.png "Label_41"
[image5]: ./channels.png "Channels"
[image6]: ./nn_results.png "NN_Results"
[image7]: ./GermanRoadSigns/x32/132.jpg "Img_1"
[image8]: ./GermanRoadSigns/x32/232.jpg "Img_2"
[image9]: ./GermanRoadSigns/x32/332.jpg "Img_3"
[image10]: ./GermanRoadSigns/x32/432.jpg "Img_4"
[image11]: ./GermanRoadSigns/x32/532.jpg "Img_5"
[image12]: ./int_ims.png "Performance"
[image13]: ./top_five_predictions.png "Top_Five_Predictions"
[image14]: ./structure.jpg "Network_structure"
---
...
The following histogram shows the distribution of training, validation and
test set images per label:
![alt text][image1]
An example image was visualised for each label. Three are displayed below:
![alt text][image2]
![alt text][image3]
![alt text][image4]
Each image has three channels (red, green, blue). The three channels are
visualized below for an example image:
![alt text][image5]
However, none of the images seem to be appearing when .md is viewed on Github. Can anyone show me where I am going wrong here?
In the actual .md file you are not using relative URLs like in your supposed quote, but absolute ones like this:
https://github.com/markroche92/SDND-Traffic-Sign-Classification/blob/master/structure.JPG
This won’t work because it is actually a standard GitHub file page, not the image itself. To link to the image, remove /blob from the path and change the domain to rawgit.com – or actually use relative URLs with or without leading ./, but make sure to get the letter case right.
https://rawgit.com/markroche92/SDND-Traffic-Sign-Classification/master/structure.JPG
structure.JPG
I also had this issue on some of my images, but not others. It ended up being how I capitalized my image names in my markdown file. For example:
Image name on my computer:
oneGreatImage.png
Image name in my Markdown file:
onegreatImage.png
When I capitalized the G again and pushed the changes it loaded just fine.
It appears that GitHub is VERY picky about matching the filenames on the images so double check that.
Related
I am learning R markdown and currently trying to add an image as per this excellent site https://www.earthdatascience.org/courses/earth-analytics/document-your-science/add-images-to-rmarkdown-report/
I have saved the example dog image but am having problems importing it into the simplest R markdown file. I have tried several ways (not just the way described on the site). I use knitr in Rstudio.
The first way that doesnt work is this where I give the subfolder under my working directory (I have also tried it without the slash before "images" and by giving the full path name).
---
title: "myImage"
output: html_document
---
This is a markdown to display an image
![an image caption Source: Ultimate Funny Dog Videos Compilation 2013.](/images/silly-dog.png)
I have also tried this but this doesnt work either
---
title: "myImage"
output: html_document
---
This is a markdown to display an image
```{r}
knitr::include_graphics("C:/Users/myname/Documents/Programs//R/images/silly-dog.png")
```
In both cases R says it can't find the image file "File /images/silly-dog.png not found in resource path" (but it is there - in the images subfolder)
many thanks for any tips
my apologies I have found the problem and it is a silly one.
When I right clicked on my image in the folder and copied the path I discovered the file was actually called silly-dog.png.jpg
this now works
![an image caption Source: Ultimate Funny Dog Videos Compilation 2013.](/Users/berna/Documents/Programs/R/images/silly-dog.png.jpg)
sorry to have taken your time
I need to add a custom marker on a custom map. The marker png image file was added to Resources/drawable in Android folder. But when I called the below line, the image file name was flagged with red underline. Hovering over it, I saw the message 'Resource.Drawable' does not contain a definition for 'orange_pin_thick_outline_nofill'. The image file's Build Action is set to AndroidResource. I also tried EmbeddedResouce. But the result is the same.
It looks like that none of the image files are recognizable. Those that did show up after I typed Resource.Drawable are probably some built-in images. Any idea how can I get my marker image using FromResource()?
BitmapDescriptorFactory.FromResource(Resource.Drawable.orange_pin_thick_outline_nofill)
Try the full name by adding the file Extension.
try this :
BitmapDescriptorFactory.FromBundle("your_image.png");
or :
BitmapDescriptorFactory.FromView(new BindingPinView("", "your_image.png"));
Using sphinx 1.3.6, I cannot find a way to make numbered references to figures.
According to answers and comments here: Referencing figures with numbers in Sphinx and reStructuredText,
numref is built into Sphinx.
But this simply does not work:
.. _mylabel
.. figure:: img/fig.jpg
this is the caption
When I use :numref:`Figure %s <mylabel>` in the text, the result is literally Figure %s as if numref was actually not implemented at all.
Do I need something to put in conf.py or in the latex preamble?
I realise this is an old post, however I thought I'd share what helped me in this case.
The following code will add a numbered link to your image with a numbered title. For example the link Fig. 1 will link to the image with the title: Fig. 1 System Process Flow
documentation.rst File:
This is some boring documentation text which refers to the illustration in :numref:`my-image`.
.. figure:: images/process_flow.png
:name: my-image
:align: center
:width: 100%
System Process Flow
conf.py File:
Add this line to your conf.py file:
numfig = True
Your Sphinx doc will now have a link to your numbered figure.
Additionally, page.rst has to be included in some 'toctree'.
Else it will throw errors as follows:
WARNING: no number is assigned for figure:
I have some images in my documentation created as a set of reST files in Sphinx. I prefer to keep them pretty small, and I want the user to click on them to get the larger image. The smaller image is not for file size reasons but for presentation reasons. I do not find a syntactic way to combine the tags image: or figure: with ref: or link:.
.. image:: _static/my_image_small.png
and I have a bigger version in the same folder: my_image_large.png.
If you come up with a solution, should the larger image just be a file with an explicit link to it or do I create a reST file with an additional image: tag? An alternative could be to play with the image sizes in the reST file, but then I still do not know how to create the link from the small image to the large image. Is there a way to bypass the Sphinx generator and just give the HTML that I want?
There are two ways you can do it.
The first is to just insert a bit of "raw" HTML:
.. raw:: html
<a href=....><img src=....
The second is to make the image clickable. That way you can link it to a bigger image:
.. image:: _static/my_image_small.png
:target: _static/my_image_large.png
There are more options you can give, btw. See the full list in the restructured text documentation.
I use Sphinx to generate some docs. I have a reStructuredText document and I'd like to put an image into it. The case is that the image should be clickable so that after a user clicks the image then they should be shown this image in full size. I use the image directive and its target option like this:
.. image:: /images/some_image.png
:alt: Image descripion
:align: center
:target: `big_some_image`_
.. _big_some_image: /images/some_image.png
The problem is that in the rendered page I get:
<img src="../../../_images/some_image.png">
So there is correct src from the image directive but an incorrect href attribute from the hyperlink.
Questions:
is there any way to generate links in the way that image directive does it? I mean relative to the document.
is there any other (built in) way to have "thumbnail-> click -> big image" behaviour?
Simply use the scale option:
.. image:: large_image.png
:scale: 20%
When the scaled image is clicked on, the full image loads in its own window. So this doesn't increase the image size on the page, but that would be messy anyway.
When you use the image directive from within Sphinx, Sphinx does some special handling to find the image file and copy it into your project (like your _images directory), and then renders the HTML to point to that place.
But the target option just takes a URL as a parameter. It knows nothing about your Sphinx project, or how your images are laid out, and does not attempt to guess.
If you want to have it point to a larger version of the same file, you will likely need to do some manual steps (like maybe copying the file to a specific location), or maybe provide a relative URL to the large file, rather than the absolute URL you have in your example.
If you want to go a completely different way, you could also try overriding and modifying the HTML templates for your project to add some JavaScript to get the click-to-larger-image effect you want.
Looks like there is a Sphinx extension that does this now, and quite nicely at that, sphinxcontrib-fancybox 0.3.2. Install with pip, add it to your extensions in conf.py, and use the fancybox directive:
.. fancybox:: images/image.png
Relative links seem to work. For the Mapserver docs setup, if an image is placed in the images directory, a relative link like in the following code works in my local build. Here is an example using figure (the underscore ("_") before "images" in the target link is necessary):
.. figure:: ../../images/carto-elements.png
:height: 400
:width: 600
:align: center
:target: ../../_images/symcon-overlay.png